diff --git a/django-stubs/contrib/gis/geos/geometry.pyi b/django-stubs/contrib/gis/geos/geometry.pyi index 61dbe1b6b..3dede0ea0 100644 --- a/django-stubs/contrib/gis/geos/geometry.pyi +++ b/django-stubs/contrib/gis/geos/geometry.pyi @@ -1,3 +1,4 @@ +from collections.abc import Sequence from typing import Any from django.contrib.gis.gdal import CoordTransform, SpatialReference @@ -143,3 +144,4 @@ class LinearGeometryMixin: class GEOSGeometry(GEOSGeometryBase, ListMixin): def __init__(self, geo_input: Any, srid: int | None = ...) -> None: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... diff --git a/django-stubs/contrib/postgres/validators.pyi b/django-stubs/contrib/postgres/validators.pyi index 35cf85569..4f263df71 100644 --- a/django-stubs/contrib/postgres/validators.pyi +++ b/django-stubs/contrib/postgres/validators.pyi @@ -1,4 +1,4 @@ -from collections.abc import Iterable, Mapping +from collections.abc import Iterable, Mapping, Sequence from typing import Any from django.core.validators import MaxLengthValidator, MaxValueValidator, MinLengthValidator, MinValueValidator @@ -11,6 +11,7 @@ class KeysValidator: strict: bool def __init__(self, keys: Iterable[str], strict: bool = ..., messages: Mapping[str, str] | None = ...) -> None: ... def __call__(self, value: Any) -> None: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... # fake class RangeMaxValueValidator(MaxValueValidator): ... class RangeMinValueValidator(MinValueValidator): ... diff --git a/django-stubs/core/files/storage/filesystem.pyi b/django-stubs/core/files/storage/filesystem.pyi index a131ad86c..b4f083c45 100644 --- a/django-stubs/core/files/storage/filesystem.pyi +++ b/django-stubs/core/files/storage/filesystem.pyi @@ -1,3 +1,6 @@ +from collections.abc import Sequence +from typing import Any + from django.utils._os import _PathCompatible from .base import Storage @@ -23,3 +26,4 @@ class FileSystemStorage(Storage, StorageSettingsMixin): def file_permissions_mode(self) -> int | None: ... @property def directory_permissions_mode(self) -> int | None: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... # fake diff --git a/django-stubs/core/files/storage/memory.pyi b/django-stubs/core/files/storage/memory.pyi index 97abc7ef7..3e438b89b 100644 --- a/django-stubs/core/files/storage/memory.pyi +++ b/django-stubs/core/files/storage/memory.pyi @@ -1,3 +1,6 @@ +from collections.abc import Sequence +from typing import Any + from django.utils._os import _PathCompatible from .base import Storage @@ -21,3 +24,4 @@ class InMemoryStorage(Storage, StorageSettingsMixin): def file_permissions_mode(self) -> int | None: ... @property def directory_permissions_mode(self) -> int | None: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... # fake diff --git a/django-stubs/core/validators.pyi b/django-stubs/core/validators.pyi index 0dea86dbd..b9b4d91e8 100644 --- a/django-stubs/core/validators.pyi +++ b/django-stubs/core/validators.pyi @@ -28,6 +28,7 @@ class RegexValidator: flags: RegexFlag | None = ..., ) -> None: ... def __call__(self, value: Any) -> None: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... class URLValidator(RegexValidator): ul: str @@ -61,6 +62,7 @@ class EmailValidator: def __call__(self, value: str | None) -> None: ... def validate_domain_part(self, domain_part: str) -> bool: ... def __eq__(self, other: object) -> bool: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... validate_email: EmailValidator slug_re: Pattern[str] @@ -91,6 +93,7 @@ class BaseValidator: def compare(self, a: Any, b: Any) -> bool: ... def clean(self, x: Any) -> Any: ... def __eq__(self, other: object) -> bool: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... class MaxValueValidator(BaseValidator): ... class MinValueValidator(BaseValidator): ... @@ -109,6 +112,7 @@ class DecimalValidator: def __init__(self, max_digits: int | None, decimal_places: int | None) -> None: ... def __call__(self, value: Decimal) -> None: ... def __eq__(self, other: object) -> bool: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... class FileExtensionValidator: message: _StrOrPromise @@ -121,6 +125,7 @@ class FileExtensionValidator: code: str | None = ..., ) -> None: ... def __call__(self, value: File) -> None: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... def get_available_image_extensions() -> Sequence[str]: ... def validate_image_file_extension(value: File) -> None: ... @@ -130,3 +135,4 @@ class ProhibitNullCharactersValidator: code: str def __init__(self, message: _StrOrPromise | None = ..., code: str | None = ...) -> None: ... def __call__(self, value: Any) -> None: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... diff --git a/django-stubs/db/models/expressions.pyi b/django-stubs/db/models/expressions.pyi index c0296cd0f..7559af20f 100644 --- a/django-stubs/db/models/expressions.pyi +++ b/django-stubs/db/models/expressions.pyi @@ -109,6 +109,7 @@ class BaseExpression: def as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... class Expression(BaseExpression, Combinable): ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... class CombinedExpression(SQLiteNumericMixin, Expression): connector: str @@ -148,6 +149,7 @@ class F(Combinable): nulls_last: bool | None = ..., ) -> OrderBy: ... def copy(self) -> F: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... class ResolvedOuterRef(F): contains_aggregate: ClassVar[bool] @@ -177,6 +179,7 @@ class Func(SQLiteNumericMixin, Expression): arg_joiner: str | None = ..., **extra_context: Any, ) -> _AsSqlType: ... + def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ... class Value(Expression): value: Any diff --git a/scripts/stubtest/allowlist_todo.txt b/scripts/stubtest/allowlist_todo.txt index cb4e72e84..9d25cbff0 100644 --- a/scripts/stubtest/allowlist_todo.txt +++ b/scripts/stubtest/allowlist_todo.txt @@ -209,9 +209,7 @@ django.contrib.auth.password_validation.exceeds_maximum_length_ratio django.contrib.auth.tokens.PasswordResetTokenGenerator._make_token_with_timestamp django.contrib.auth.tokens.PasswordResetTokenGenerator.algorithm django.contrib.auth.validators.ASCIIUsernameValidator.__new__ -django.contrib.auth.validators.ASCIIUsernameValidator.deconstruct django.contrib.auth.validators.UnicodeUsernameValidator.__new__ -django.contrib.auth.validators.UnicodeUsernameValidator.deconstruct django.contrib.auth.views.INTERNAL_RESET_URL_TOKEN django.contrib.auth.views.LoginView.form_class django.contrib.auth.views.LogoutView.get_next_page @@ -331,7 +329,6 @@ django.contrib.gis.db.models.BinaryField.get_placeholder django.contrib.gis.db.models.BooleanField.formfield django.contrib.gis.db.models.Case.__new__ django.contrib.gis.db.models.Case.as_sql -django.contrib.gis.db.models.Case.deconstruct django.contrib.gis.db.models.CharField.cast_db_type django.contrib.gis.db.models.CharField.description django.contrib.gis.db.models.CharField.formfield @@ -358,14 +355,11 @@ django.contrib.gis.db.models.Empty django.contrib.gis.db.models.Exists.empty_result_set_value django.contrib.gis.db.models.Exists.select_format django.contrib.gis.db.models.Expression.__new__ -django.contrib.gis.db.models.Expression.deconstruct django.contrib.gis.db.models.Expression.identity django.contrib.gis.db.models.ExpressionWrapper.__new__ -django.contrib.gis.db.models.ExpressionWrapper.deconstruct django.contrib.gis.db.models.Extent.is_extent django.contrib.gis.db.models.Extent3D.is_extent django.contrib.gis.db.models.F.__new__ -django.contrib.gis.db.models.F.deconstruct django.contrib.gis.db.models.Field.__copy__ django.contrib.gis.db.models.Field.__deepcopy__ django.contrib.gis.db.models.Field.__ge__ @@ -447,7 +441,6 @@ django.contrib.gis.db.models.ForeignObjectRel.one_to_one django.contrib.gis.db.models.ForeignObjectRel.path_infos django.contrib.gis.db.models.ForeignObjectRel.related_model django.contrib.gis.db.models.Func.__new__ -django.contrib.gis.db.models.Func.deconstruct django.contrib.gis.db.models.Func.function django.contrib.gis.db.models.GenericIPAddressField.formfield django.contrib.gis.db.models.GeoAggregate @@ -499,7 +492,6 @@ django.contrib.gis.db.models.OneToOneRel.__init__ django.contrib.gis.db.models.OrderBy.__new__ django.contrib.gis.db.models.OrderBy.as_oracle django.contrib.gis.db.models.OrderBy.as_sql -django.contrib.gis.db.models.OrderBy.deconstruct django.contrib.gis.db.models.PositiveBigIntegerField.formfield django.contrib.gis.db.models.PositiveBigIntegerField.integer_field_class django.contrib.gis.db.models.PositiveIntegerField.formfield @@ -546,13 +538,11 @@ django.contrib.gis.db.models.UniqueConstraint.__init__ django.contrib.gis.db.models.UniqueConstraint.contains_expressions django.contrib.gis.db.models.UniqueConstraint.validate django.contrib.gis.db.models.Value.__new__ -django.contrib.gis.db.models.Value.deconstruct django.contrib.gis.db.models.Value.empty_result_set_value django.contrib.gis.db.models.Value.for_save django.contrib.gis.db.models.Variance.__init__ django.contrib.gis.db.models.When.__new__ django.contrib.gis.db.models.When.as_sql -django.contrib.gis.db.models.When.deconstruct django.contrib.gis.db.models.Window.as_sql django.contrib.gis.db.models.Window.as_sqlite django.contrib.gis.db.models.aggregates.Extent.is_extent @@ -657,10 +647,8 @@ django.contrib.gis.geometry.hex_regex django.contrib.gis.geometry.json_regex django.contrib.gis.geometry.wkt_regex django.contrib.gis.geos.GEOSGeometry.__new__ -django.contrib.gis.geos.GEOSGeometry.deconstruct django.contrib.gis.geos.Point.tuple django.contrib.gis.geos.geometry.GEOSGeometry.__new__ -django.contrib.gis.geos.geometry.GEOSGeometry.deconstruct django.contrib.gis.geos.geometry.GEOSGeometryBase.geojson django.contrib.gis.geos.geometry.GEOSGeometryBase.make_valid django.contrib.gis.geos.geometry.GEOSGeometryBase.normalize @@ -795,7 +783,6 @@ django.contrib.postgres.search.SearchVectorExact.process_rhs django.contrib.postgres.search.SearchVectorField.class_lookups django.contrib.postgres.signals.get_type_oids django.contrib.postgres.validators.KeysValidator.__new__ -django.contrib.postgres.validators.KeysValidator.deconstruct django.contrib.redirects.admin.RedirectAdmin django.contrib.redirects.models.Redirect.id django.contrib.redirects.models.Redirect.new_path @@ -863,14 +850,12 @@ django.core.files.locks.ULONG_PTR django.core.files.storage.FileSystemStorage.__new__ django.core.files.storage.FileSystemStorage.base_location django.core.files.storage.FileSystemStorage.base_url -django.core.files.storage.FileSystemStorage.deconstruct django.core.files.storage.FileSystemStorage.directory_permissions_mode django.core.files.storage.FileSystemStorage.file_permissions_mode django.core.files.storage.FileSystemStorage.location django.core.files.storage.InMemoryStorage.__new__ django.core.files.storage.InMemoryStorage.base_location django.core.files.storage.InMemoryStorage.base_url -django.core.files.storage.InMemoryStorage.deconstruct django.core.files.storage.InMemoryStorage.directory_permissions_mode django.core.files.storage.InMemoryStorage.file_permissions_mode django.core.files.storage.InMemoryStorage.location @@ -878,7 +863,6 @@ django.core.files.storage.StorageHandler.backends django.core.files.storage.filesystem.FileSystemStorage.__new__ django.core.files.storage.filesystem.FileSystemStorage.base_location django.core.files.storage.filesystem.FileSystemStorage.base_url -django.core.files.storage.filesystem.FileSystemStorage.deconstruct django.core.files.storage.filesystem.FileSystemStorage.directory_permissions_mode django.core.files.storage.filesystem.FileSystemStorage.file_permissions_mode django.core.files.storage.filesystem.FileSystemStorage.location @@ -886,7 +870,6 @@ django.core.files.storage.handler.StorageHandler.backends django.core.files.storage.memory.InMemoryStorage.__new__ django.core.files.storage.memory.InMemoryStorage.base_location django.core.files.storage.memory.InMemoryStorage.base_url -django.core.files.storage.memory.InMemoryStorage.deconstruct django.core.files.storage.memory.InMemoryStorage.directory_permissions_mode django.core.files.storage.memory.InMemoryStorage.file_permissions_mode django.core.files.storage.memory.InMemoryStorage.location @@ -1022,32 +1005,20 @@ django.core.signing.b62_decode django.core.signing.b62_encode django.core.signing.loads django.core.validators.BaseValidator.__new__ -django.core.validators.BaseValidator.deconstruct django.core.validators.DecimalValidator.__new__ -django.core.validators.DecimalValidator.deconstruct django.core.validators.EmailValidator.__new__ -django.core.validators.EmailValidator.deconstruct django.core.validators.EmailValidator.domain_regex django.core.validators.EmailValidator.literal_regex django.core.validators.EmailValidator.user_regex django.core.validators.FileExtensionValidator.__new__ -django.core.validators.FileExtensionValidator.deconstruct django.core.validators.MaxLengthValidator.__new__ -django.core.validators.MaxLengthValidator.deconstruct django.core.validators.MaxValueValidator.__new__ -django.core.validators.MaxValueValidator.deconstruct django.core.validators.MinLengthValidator.__new__ -django.core.validators.MinLengthValidator.deconstruct django.core.validators.MinValueValidator.__new__ -django.core.validators.MinValueValidator.deconstruct django.core.validators.ProhibitNullCharactersValidator.__new__ -django.core.validators.ProhibitNullCharactersValidator.deconstruct django.core.validators.RegexValidator.__new__ -django.core.validators.RegexValidator.deconstruct django.core.validators.StepValueValidator.__new__ -django.core.validators.StepValueValidator.deconstruct django.core.validators.URLValidator.__new__ -django.core.validators.URLValidator.deconstruct django.core.validators.URLValidator.regex django.core.validators.URLValidator.unsafe_chars django.core.validators.URLValidator.max_length @@ -1266,7 +1237,6 @@ django.db.models.BinaryField.get_placeholder django.db.models.BooleanField.formfield django.db.models.Case.__new__ django.db.models.Case.as_sql -django.db.models.Case.deconstruct django.db.models.CharField.cast_db_type django.db.models.CharField.description django.db.models.CharField.formfield @@ -1293,12 +1263,9 @@ django.db.models.Empty django.db.models.Exists.empty_result_set_value django.db.models.Exists.select_format django.db.models.Expression.__new__ -django.db.models.Expression.deconstruct django.db.models.Expression.identity django.db.models.ExpressionWrapper.__new__ -django.db.models.ExpressionWrapper.deconstruct django.db.models.F.__new__ -django.db.models.F.deconstruct django.db.models.Field.__copy__ django.db.models.Field.__deepcopy__ django.db.models.Field.__ge__ @@ -1380,7 +1347,6 @@ django.db.models.ForeignObjectRel.one_to_one django.db.models.ForeignObjectRel.path_infos django.db.models.ForeignObjectRel.related_model django.db.models.Func.__new__ -django.db.models.Func.deconstruct django.db.models.Func.function django.db.models.GenericIPAddressField.formfield django.db.models.ImageField.__get__ @@ -1430,7 +1396,6 @@ django.db.models.OneToOneRel.__init__ django.db.models.OrderBy.__new__ django.db.models.OrderBy.as_oracle django.db.models.OrderBy.as_sql -django.db.models.OrderBy.deconstruct django.db.models.PositiveBigIntegerField.formfield django.db.models.PositiveBigIntegerField.integer_field_class django.db.models.PositiveIntegerField.formfield @@ -1476,13 +1441,11 @@ django.db.models.UniqueConstraint.__init__ django.db.models.UniqueConstraint.contains_expressions django.db.models.UniqueConstraint.validate django.db.models.Value.__new__ -django.db.models.Value.deconstruct django.db.models.Value.empty_result_set_value django.db.models.Value.for_save django.db.models.Variance.__init__ django.db.models.When.__new__ django.db.models.When.as_sql -django.db.models.When.deconstruct django.db.models.Window.as_sql django.db.models.Window.as_sqlite django.db.models.aggregates.Aggregate.__init__ @@ -1533,25 +1496,19 @@ django.db.models.expressions.BaseExpression.replace_expressions django.db.models.expressions.BaseExpression.select_format django.db.models.expressions.Case.__new__ django.db.models.expressions.Case.as_sql -django.db.models.expressions.Case.deconstruct django.db.models.expressions.Col.relabeled_clone django.db.models.expressions.Exists.empty_result_set_value django.db.models.expressions.Exists.select_format django.db.models.expressions.Expression.__new__ -django.db.models.expressions.Expression.deconstruct django.db.models.expressions.Expression.identity django.db.models.expressions.ExpressionWrapper.__new__ -django.db.models.expressions.ExpressionWrapper.deconstruct django.db.models.expressions.F.__new__ -django.db.models.expressions.F.deconstruct django.db.models.expressions.Func.__new__ -django.db.models.expressions.Func.deconstruct django.db.models.expressions.Func.function django.db.models.expressions.NegatedExpression.select_format django.db.models.expressions.OrderBy.__new__ django.db.models.expressions.OrderBy.as_oracle django.db.models.expressions.OrderBy.as_sql -django.db.models.expressions.OrderBy.deconstruct django.db.models.expressions.Ref.get_refs django.db.models.expressions.Ref.relabeled_clone django.db.models.expressions.ResolvedOuterRef.as_sql @@ -1563,12 +1520,10 @@ django.db.models.expressions.Subquery.external_aliases django.db.models.expressions.Subquery.get_external_cols django.db.models.expressions.Subquery.subquery django.db.models.expressions.Value.__new__ -django.db.models.expressions.Value.deconstruct django.db.models.expressions.Value.empty_result_set_value django.db.models.expressions.Value.for_save django.db.models.expressions.When.__new__ django.db.models.expressions.When.as_sql -django.db.models.expressions.When.deconstruct django.db.models.expressions.Window.as_sql django.db.models.expressions.Window.as_sqlite django.db.models.expressions.connector