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.
Django Admin Panel : In Admin Panel you will see Group in bold letter, Click on that and make 3-different group named level0, level1, level3 . Also, define the custom permissions according to the need. By Programmatically creating a group with permissions: Open python shell using python manage.py shell.
With Django, you can create groups to class users and assign permissions to each group so when creating users, you can just assign the user to a group and, in turn, the user has all the permissions from that group. To create a group, you need the Group model from django. contrib. auth.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With