Run the system checks on all ModelAdmins, except if they aren't customized at all.
(self, app_configs)
| 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 | """ |
nothing calls this directly
no test coverage detected