MCPcopy
hub / github.com/django/django / get_perm

Function get_perm

tests/admin_views/tests.py:2330–2333  ·  view source on GitHub ↗

Return the permission object, for the Model

(Model, codename)

Source from the content-addressed store, hash-verified

2328
2329
2330def get_perm(Model, codename):
2331 """Return the permission object, for the Model"""
2332 ct = ContentType.objects.get_for_model(Model, for_concrete_model=False)
2333 return Permission.objects.get(content_type=ct, codename=codename)
2334
2335
2336@override_settings(

Calls 2

get_for_modelMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…