From d0dea620c7cb127fb688674fe7510d98cecc44a2 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Thu, 16 Jan 2025 11:38:44 -0500 Subject: [PATCH] Add "User.Meta" and "AbstractUser.Meta" classes --- django-stubs/contrib/auth/models.pyi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/django-stubs/contrib/auth/models.pyi b/django-stubs/contrib/auth/models.pyi index 78702f1e7..86d0b0150 100644 --- a/django-stubs/contrib/auth/models.pyi +++ b/django-stubs/contrib/auth/models.pyi @@ -84,13 +84,17 @@ class AbstractUser(AbstractBaseUser, PermissionsMixin): EMAIL_FIELD: str USERNAME_FIELD: str + # This ought to inherit from TypedModelMeta + class Meta: ... + def get_full_name(self) -> str: ... def get_short_name(self) -> str: ... def email_user( self, subject: _StrOrPromise, message: _StrOrPromise, from_email: str = ..., **kwargs: Any ) -> None: ... -class User(AbstractUser): ... +class User(AbstractUser): + class Meta(AbstractUser.Meta): ... class AnonymousUser: id: Any