1

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?

pynovice
  • 7,424
  • 25
  • 69
  • 109

1 Answers1

0

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>]
schneck
  • 10,556
  • 11
  • 49
  • 74