diff --git a/mypy_django_plugin/main.py b/mypy_django_plugin/main.py index 990a6e3da..7cba2129e 100644 --- a/mypy_django_plugin/main.py +++ b/mypy_django_plugin/main.py @@ -238,7 +238,10 @@ def get_base_class_hook(self, fullname: str) -> Optional[Callable[[ClassDefConte sym is not None and isinstance(sym.node, TypeInfo) and sym.node.metaclass_type is not None - and sym.node.metaclass_type.type.fullname == fullnames.MODEL_METACLASS_FULLNAME + and ( + sym.node.metaclass_type.type.fullname == fullnames.MODEL_METACLASS_FULLNAME + or sym.node.metaclass_type.type.has_base(fullnames.MODEL_METACLASS_FULLNAME) + ) ): return partial(process_model_class, django_context=self.django_context)