diff --git a/django-stubs/contrib/gis/db/backends/oracle/models.pyi b/django-stubs/contrib/gis/db/backends/oracle/models.pyi index 4c59b240e..7b002731b 100644 --- a/django-stubs/contrib/gis/db/backends/oracle/models.pyi +++ b/django-stubs/contrib/gis/db/backends/oracle/models.pyi @@ -11,11 +11,6 @@ class OracleGeometryColumns(models.Model): srid: Any objects: ClassVar[Manager[Self]] - class Meta: - app_label: str - db_table: str - managed: bool - @classmethod def table_name_col(cls) -> Any: ... @classmethod @@ -30,10 +25,5 @@ class OracleSpatialRefSys(models.Model, SpatialRefSysMixin): cs_bounds: Any objects: ClassVar[Manager[Self]] - class Meta: - app_label: str - db_table: str - managed: bool - @property def wkt(self) -> Any: ... diff --git a/django-stubs/contrib/gis/db/backends/postgis/models.pyi b/django-stubs/contrib/gis/db/backends/postgis/models.pyi index 651807fa2..4bd4da16f 100644 --- a/django-stubs/contrib/gis/db/backends/postgis/models.pyi +++ b/django-stubs/contrib/gis/db/backends/postgis/models.pyi @@ -14,11 +14,6 @@ class PostGISGeometryColumns(models.Model): type: Any objects: ClassVar[models.Manager[Self]] - class Meta: - app_label: str - db_table: str - managed: bool - @classmethod def table_name_col(cls) -> Any: ... @classmethod @@ -32,10 +27,5 @@ class PostGISSpatialRefSys(models.Model, SpatialRefSysMixin): proj4text: Any objects: ClassVar[models.Manager[Self]] - class Meta: - app_label: str - db_table: str - managed: bool - @property def wkt(self) -> Any: ... diff --git a/django-stubs/contrib/gis/db/backends/spatialite/models.pyi b/django-stubs/contrib/gis/db/backends/spatialite/models.pyi index f9d7e382e..5585d2e17 100644 --- a/django-stubs/contrib/gis/db/backends/spatialite/models.pyi +++ b/django-stubs/contrib/gis/db/backends/spatialite/models.pyi @@ -13,11 +13,6 @@ class SpatialiteGeometryColumns(models.Model): type: Any objects: ClassVar[models.Manager[Self]] - class Meta: - app_label: str - db_table: str - managed: bool - @classmethod def table_name_col(cls) -> Any: ... @classmethod @@ -32,10 +27,5 @@ class SpatialiteSpatialRefSys(models.Model, SpatialRefSysMixin): srtext: Any objects: ClassVar[models.Manager[Self]] - class Meta: - app_label: str - db_table: str - managed: bool - @property def wkt(self) -> Any: ... diff --git a/django-stubs/db/models/base.pyi b/django-stubs/db/models/base.pyi index 0780af73c..8d44863bb 100644 --- a/django-stubs/db/models/base.pyi +++ b/django-stubs/db/models/base.pyi @@ -40,7 +40,6 @@ class Model(metaclass=ModelBase): # to only exist on subclasses it exists on during runtime. objects: ClassVar[Manager[Self]] - class Meta: ... _meta: ClassVar[Options[Self]] pk: Any _state: ModelState diff --git a/django-stubs/forms/forms.pyi b/django-stubs/forms/forms.pyi index 753eca7ba..b4233ee30 100644 --- a/django-stubs/forms/forms.pyi +++ b/django-stubs/forms/forms.pyi @@ -1,4 +1,4 @@ -from collections.abc import Iterable, Iterator, Mapping, Sequence +from collections.abc import Iterable, Iterator, Mapping from typing import Any, ClassVar from django.core.exceptions import ValidationError @@ -13,9 +13,6 @@ from django.utils.safestring import SafeString class DeclarativeFieldsMetaclass(MediaDefiningClass): ... class BaseForm(RenderableFormMixin): - class Meta: - fields: Sequence[str] - default_renderer: BaseRenderer | type[BaseRenderer] | None field_order: Iterable[str] | None use_required_attribute: bool diff --git a/scripts/stubtest/allowlist.txt b/scripts/stubtest/allowlist.txt index 75c82ff46..256b405bb 100644 --- a/scripts/stubtest/allowlist.txt +++ b/scripts/stubtest/allowlist.txt @@ -387,3 +387,13 @@ django.urls.resolvers.URLPattern.lookup_str django.urls.resolvers.URLResolver.url_patterns django.urls.resolvers.URLResolver.urlconf_module django.utils.connection.BaseConnectionHandler.settings + +# Ignore missing inner `Meta` class, see PR #2000 for the related discussion +django.contrib.auth.base_user.AbstractBaseUser.Meta +django.contrib.auth.forms.BaseUserCreationForm.Meta +django.contrib.auth.forms.UserChangeForm.Meta +django.contrib.auth.models.AbstractBaseUser.Meta +django.contrib.auth.models.AbstractUser.Meta +django.contrib.auth.models.PermissionsMixin.Meta +django.contrib.flatpages.forms.FlatpageForm.Meta +django.contrib.sessions.base_session.AbstractBaseSession.Meta diff --git a/scripts/stubtest/allowlist_todo.txt b/scripts/stubtest/allowlist_todo.txt index e24b4599b..0056cfe0d 100644 --- a/scripts/stubtest/allowlist_todo.txt +++ b/scripts/stubtest/allowlist_todo.txt @@ -100,7 +100,6 @@ django.contrib.auth.admin.UserAdmin.form django.contrib.auth.admin.UserAdmin.get_form django.contrib.auth.backends.RemoteUserBackend.authenticate django.contrib.auth.backends.RemoteUserBackend.configure_user -django.contrib.auth.base_user.AbstractBaseUser.Meta.abstract django.contrib.auth.base_user.AbstractBaseUser.get_session_auth_fallback_hash django.contrib.auth.base_user.AbstractBaseUser.last_login django.contrib.auth.base_user.AbstractBaseUser.password @@ -108,14 +107,10 @@ django.contrib.auth.decorators.login_required django.contrib.auth.default_app_config django.contrib.auth.forms.AdminPasswordChangeForm django.contrib.auth.forms.AuthenticationForm -django.contrib.auth.forms.BaseUserCreationForm.Meta.field_classes -django.contrib.auth.forms.BaseUserCreationForm.Meta.model django.contrib.auth.forms.BaseUserCreationForm.declared_fields django.contrib.auth.forms.PasswordChangeForm django.contrib.auth.forms.PasswordResetForm django.contrib.auth.forms.SetPasswordForm -django.contrib.auth.forms.UserChangeForm.Meta.field_classes -django.contrib.auth.forms.UserChangeForm.Meta.model django.contrib.auth.forms.UserChangeForm.declared_fields django.contrib.auth.forms.UserCreationForm.declared_fields django.contrib.auth.forms.UserModel @@ -129,13 +124,9 @@ django.contrib.auth.hashers.reset_hashers django.contrib.auth.management.commands.createsuperuser.Command.get_input_data django.contrib.auth.management.commands.createsuperuser.Command.username_is_unique django.contrib.auth.management.commands.createsuperuser.PASSWORD_FIELD -django.contrib.auth.models.AbstractBaseUser.Meta.abstract django.contrib.auth.models.AbstractBaseUser.get_session_auth_fallback_hash django.contrib.auth.models.AbstractBaseUser.last_login django.contrib.auth.models.AbstractBaseUser.password -django.contrib.auth.models.AbstractUser.Meta.abstract -django.contrib.auth.models.AbstractUser.Meta.verbose_name -django.contrib.auth.models.AbstractUser.Meta.verbose_name_plural django.contrib.auth.models.AbstractUser.date_joined django.contrib.auth.models.AbstractUser.email django.contrib.auth.models.AbstractUser.email_user @@ -163,7 +154,6 @@ django.contrib.auth.models.Permission.content_type_id django.contrib.auth.models.Permission.id django.contrib.auth.models.Permission.name django.contrib.auth.models.PermissionManager.__slotnames__ -django.contrib.auth.models.PermissionsMixin.Meta.abstract django.contrib.auth.models.PermissionsMixin.groups django.contrib.auth.models.PermissionsMixin.is_superuser django.contrib.auth.models.PermissionsMixin.user_permissions @@ -214,7 +204,6 @@ django.contrib.contenttypes.models.ContentType.permission_set django.contrib.contenttypes.models.ContentTypeManager.__init__ django.contrib.contenttypes.models.ContentTypeManager.__slotnames__ django.contrib.flatpages.admin.FlatPageAdmin -django.contrib.flatpages.forms.FlatpageForm.Meta.model django.contrib.flatpages.forms.FlatpageForm.declared_fields django.contrib.flatpages.models.FlatPage.content django.contrib.flatpages.models.FlatPage.enable_comments @@ -253,14 +242,10 @@ django.contrib.gis.db.backends.oracle.features.DatabaseFeatures.django_test_skip django.contrib.gis.db.backends.oracle.features.DatabaseFeatures.supports_tolerance_parameter django.contrib.gis.db.backends.oracle.features.DatabaseFeatures.unsupported_geojson_options django.contrib.gis.db.backends.oracle.introspection -django.contrib.gis.db.backends.oracle.models.OracleGeometryColumns.Meta -django.contrib.gis.db.backends.oracle.models.OracleSpatialRefSys.Meta django.contrib.gis.db.backends.oracle.operations django.contrib.gis.db.backends.postgis.adapter.PostGISAdapter.prepare django.contrib.gis.db.backends.postgis.features.DatabaseFeatures.empty_intersection_returns_none django.contrib.gis.db.backends.postgis.features.DatabaseFeatures.supports_geography -django.contrib.gis.db.backends.postgis.models.PostGISGeometryColumns.Meta -django.contrib.gis.db.backends.postgis.models.PostGISSpatialRefSys.Meta django.contrib.gis.db.backends.postgis.operations.PostGISOperations.convert_extent django.contrib.gis.db.backends.postgis.operations.PostGISOperations.convert_extent3d django.contrib.gis.db.backends.postgis.operations.PostGISOperator.check_geography @@ -268,8 +253,6 @@ django.contrib.gis.db.backends.postgis.schema.PostGISSchemaEditor.rast_index_tem django.contrib.gis.db.backends.spatialite.base.DatabaseWrapper.ops django.contrib.gis.db.backends.spatialite.features.DatabaseFeatures.can_alter_geometry_field django.contrib.gis.db.backends.spatialite.features.DatabaseFeatures.django_test_skips -django.contrib.gis.db.backends.spatialite.models.SpatialiteGeometryColumns.Meta -django.contrib.gis.db.backends.spatialite.models.SpatialiteSpatialRefSys.Meta django.contrib.gis.db.backends.spatialite.operations.SpatiaLiteOperations.convert_extent django.contrib.gis.db.backends.spatialite.operations.SpatiaLiteOperations.from_text django.contrib.gis.db.backends.spatialite.operations.SpatiaLiteOperations.geom_lib_version @@ -403,7 +386,6 @@ django.contrib.gis.db.models.ManyToManyField.reverse_path_infos django.contrib.gis.db.models.ManyToManyRel.identity django.contrib.gis.db.models.ManyToOneRel.__init__ django.contrib.gis.db.models.ManyToOneRel.identity -django.contrib.gis.db.models.Model.Meta django.contrib.gis.db.models.Model.add_to_class django.contrib.gis.db.models.ObjectDoesNotExist django.contrib.gis.db.models.OneToOneField.__get__ @@ -464,7 +446,6 @@ django.contrib.gis.db.models.functions.Length.as_sql django.contrib.gis.db.models.lookups.RasterBandTransform.as_sql django.contrib.gis.default_app_config django.contrib.gis.forms.ALL_FIELDS -django.contrib.gis.forms.BaseForm.Meta django.contrib.gis.forms.BaseForm.__init__ django.contrib.gis.forms.BaseFormSet.__init__ django.contrib.gis.forms.BaseFormSet.deletion_widget @@ -646,9 +627,6 @@ django.contrib.sessions.backends.base.SessionBase.get django.contrib.sessions.backends.base.SessionBase.setdefault django.contrib.sessions.backends.base.SessionBase.update django.contrib.sessions.backends.signed_cookies.SessionStore.exists -django.contrib.sessions.base_session.AbstractBaseSession.Meta.abstract -django.contrib.sessions.base_session.AbstractBaseSession.Meta.verbose_name -django.contrib.sessions.base_session.AbstractBaseSession.Meta.verbose_name_plural django.contrib.sessions.base_session.AbstractBaseSession.expire_date django.contrib.sessions.base_session.AbstractBaseSession.get_next_by_expire_date django.contrib.sessions.base_session.AbstractBaseSession.get_previous_by_expire_date @@ -952,7 +930,6 @@ django.db.models.ManyToManyField.reverse_path_infos django.db.models.ManyToManyRel.identity django.db.models.ManyToOneRel.__init__ django.db.models.ManyToOneRel.identity -django.db.models.Model.Meta django.db.models.Model.add_to_class django.db.models.ObjectDoesNotExist django.db.models.OneToOneField.__get__ @@ -1007,7 +984,6 @@ django.db.models.aggregates.StdDev.__init__ django.db.models.aggregates.Variance.__init__ django.db.models.base.DEFERRED django.db.models.base.Deferred -django.db.models.base.Model.Meta django.db.models.base.Model.add_to_class django.db.models.base.ModelBase.__new__ django.db.models.base.ModelBase.add_to_class @@ -1469,7 +1445,6 @@ django.db.utils.ConnectionHandler.ensure_defaults django.db.utils.ConnectionHandler.prepare_test_settings django.db.utils.DatabaseErrorWrapper.__call__ django.forms.ALL_FIELDS -django.forms.BaseForm.Meta django.forms.BaseForm.__init__ django.forms.BaseFormSet.__init__ django.forms.BaseFormSet.deletion_widget @@ -1520,7 +1495,6 @@ django.forms.fields.FileField.bound_data django.forms.fields.MultiValueField.__deepcopy__ django.forms.fields.MultipleChoiceField.hidden_widget django.forms.fields.SplitDateTimeField.hidden_widget -django.forms.forms.BaseForm.Meta django.forms.forms.BaseForm.__init__ django.forms.forms.DeclarativeFieldsMetaclass.__new__ django.forms.forms.Form