I've added permission to my model and I would like to create a group in admin that uses this permission.
The problem is that the new permission is not listed in the permissions list.
is there something I need to do to add it to that list?
class Meta:
permissions = (
("add_remove_job", "Can add/remove jobs"),
)
SOLUTION: It is a known limitation of South, the solution is to do syncdb --all
try:
manage.py syncdb --all
Otherwise, You can force django to generate permissions for a particular app:
from django.contrib.auth.management import create_permissions
from django.apps import apps
create_permissions(apps.get_app_config('my_app_name'))
This will do all models in the app. You can substitute a list of model class objects instead of 'get_models()' if you only want a subset.
What you need to do is a syncdb each time you add/modify a permission for a model.
python manage.py syncdb
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