| | 11 | |
| | 12 | `bmispelon` and I found that the problem actually originates here: |
| | 13 | https://github.com/django/django/blob/master/django/core/checks/model_checks.py#L14 |
| | 14 | |
| | 15 | {{{ |
| | 16 | @register(Tags.models) |
| | 17 | def check_all_models(app_configs=None, **kwargs): |
| | 18 | errors = [model.check(**kwargs) |
| | 19 | for model in apps.get_models() |
| | 20 | if app_configs is None or model._meta.app_config in app_configs] |
| | 21 | return list(chain(*errors)) |
| | 22 | }}} |
| | 23 | |
| | 24 | We would therefore need to check (no pun intended) that the `check` attribute on the `model` instance does not resolve to a field, before actually calling it as a method, something to the tune of: |
| | 25 | {{{ |
| | 26 | if mdl._meta.get_field_by_name("check"): |
| | 27 | pass |
| | 28 | }}} |