MCPcopy
hub / github.com/django/django / check

Method check

django/contrib/admin/sites.py:77–93  ·  view source on GitHub ↗

Run the system checks on all ModelAdmins, except if they aren't customized at all.

(self, app_configs)

Source from the content-addressed store, hash-verified

75 return f"{self.__class__.__name__}(name={self.name!r})"
76
77 def check(self, app_configs):
78 """
79 Run the system checks on all ModelAdmins, except if they aren't
80 customized at all.
81 """
82 if app_configs is None:
83 app_configs = apps.get_app_configs()
84 app_configs = set(app_configs) # Speed up lookups below
85
86 errors = []
87 modeladmins = (
88 o for o in self._registry.values() if o.__class__ is not ModelAdmin
89 )
90 for modeladmin in modeladmins:
91 if modeladmin.model._meta.app_config in app_configs:
92 errors.extend(modeladmin.check())
93 return errors
94
95 def register(self, model_or_iterable, admin_class=None, **options):
96 """

Callers

nothing calls this directly

Calls 3

get_app_configsMethod · 0.80
extendMethod · 0.80
valuesMethod · 0.45

Tested by

no test coverage detected