MCPcopy
hub / github.com/django/django / get_by_natural_key

Method get_by_natural_key

django/contrib/auth/models.py:30–36  ·  view source on GitHub ↗
(self, codename, app_label, model)

Source from the content-addressed store, hash-verified

28 use_in_migrations = True
29
30 def get_by_natural_key(self, codename, app_label, model):
31 return self.get(
32 codename=codename,
33 content_type=ContentType.objects.db_manager(self.db).get_by_natural_key(
34 app_label, model
35 ),
36 )
37
38
39class Permission(models.Model):

Callers

nothing calls this directly

Calls 3

db_managerMethod · 0.80
getMethod · 0.45
get_by_natural_keyMethod · 0.45

Tested by

no test coverage detected