I want to list the permissions created by django for a model for specific app like it is done in django backend while creating users:
app_name | model_name | can add model_name
How to do this?
I want to list the permissions created by django for a model for specific app like it is done in django backend while creating users:
app_name | model_name | can add model_name
How to do this?
You could retrieve it from the Permissions model, like:
>>> Permission.objects.filter(content_type=ContentType.objects.get(app_label='auth',
model='user'))
[<Permission: auth | user | Can add user>, <Permission:
auth | user | Can change user>, <Permission: auth | user | Can delete
user>]