Adding new custom permissions in Django

gerdemb picture gerdemb · Nov 16, 2009 · Viewed 32.7k times · Source

I am using custom permissions in my Django models like this:

class T21Turma(models.Model):
    class Meta:
        permissions = (("can_view_boletim", "Can view boletim"),
                       ("can_view_mensalidades", "Can view mensalidades"),)

The problem is that when I add a permission to the list it doesn't get added to the auth_permission table when I run syncdb. What am I doing wrong. If it makes any difference I am using south for database migrations.

Answer

Daniel Naab picture Daniel Naab · Nov 16, 2009

South does not track django.contrib.auth permissions. See ticket #211 for more information.

One of the comments on the ticket suggests that using the --all option on syncdb may solve the problem.