Open
Description
Bug report
What's wrong
Since version 5.0.0 (probably since #2000), the following code fails:
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
class Meta(AbstractUser.Meta): # error: Name "AbstractUser.Meta" is not defined
pass
obviously this example is shortened, but I think you get the Idea. While it is true that a basic Model
does not have a Meta
-attribute, this is not valid for basically any Subclass for Meta, and using this inheritance is actually the recommended way by django docs:
- https://docs.djangoproject.com/en/dev/topics/db/models/#meta-inheritance
- https://docs.djangoproject.com/en/dev/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project
How is that should be
AbstractUser.Meta
should exist for inheritance.
System information
- OS: Linux (Alpine and Arch tested, but the problem should be valid regardless)
python
version: 3.12django
version: 5.0.4mypy
version: 1.10.0django-stubs
version: 5.0.0django-stubs-ext
version: none