def model_modules(self) -> dict[str, dict[str, type[Model]]]:
        """All modules that contain Django models."""
        modules: dict[str, dict[str, type[Model]]] = defaultdict(dict)
        for concrete_model_cls in self.apps_registry.get_models(include_auto_created=True, include_swapped=True):
            modules[concrete_model_cls.__module__][concrete_model_cls.__name__] = concrete_model_cls
            # collect abstract=True models
            for model_cls in concrete_model_cls.mro()[1:]:
                if issubclass(model_cls, Model) and hasattr(model_cls, "_meta") and model_cls._meta.abstract:
                    modules[model_cls.__module__][model_cls.__name__] = model_cls
        return modules
All modules that contain Django models.
mypy_django_plugin/django/context.py