From 1e2eda06ba3fe0a0c151825b6f2fba4bf20df47b Mon Sep 17 00:00:00 2001 From: sudosubin Date: Sat, 20 Apr 2024 17:54:19 +0900 Subject: [PATCH] 5.0: Update `django.contrib.postgres` --- .../contrib/postgres/aggregates/__init__.pyi | 1 + .../contrib/postgres/aggregates/general.pyi | 38 +++++++- .../contrib/postgres/aggregates/mixins.pyi | 18 +++- .../postgres/aggregates/statistics.pyi | 12 ++- django-stubs/contrib/postgres/constraints.pyi | 13 ++- .../contrib/postgres/fields/array.pyi | 9 +- .../contrib/postgres/fields/citext.pyi | 6 +- .../contrib/postgres/fields/hstore.pyi | 3 + .../contrib/postgres/fields/jsonb.pyi | 5 -- .../contrib/postgres/fields/ranges.pyi | 41 ++++++--- .../contrib/postgres/forms/__init__.pyi | 15 +++- django-stubs/contrib/postgres/forms/jsonb.pyi | 7 -- django-stubs/contrib/postgres/lookups.pyi | 7 +- django-stubs/contrib/postgres/search.pyi | 28 +++++- django-stubs/contrib/postgres/signals.pyi | 5 +- django-stubs/db/models/aggregates.pyi | 1 + django-stubs/db/models/lookups.pyi | 4 +- django-stubs/forms/widgets.pyi | 3 +- scripts/stubtest/allowlist_todo.txt | 90 ------------------- tests/typecheck/test_import_all.yml | 1 - 20 files changed, 170 insertions(+), 137 deletions(-) delete mode 100644 django-stubs/contrib/postgres/forms/jsonb.pyi diff --git a/django-stubs/contrib/postgres/aggregates/__init__.pyi b/django-stubs/contrib/postgres/aggregates/__init__.pyi index fbb15e1d5..217067c5e 100644 --- a/django-stubs/contrib/postgres/aggregates/__init__.pyi +++ b/django-stubs/contrib/postgres/aggregates/__init__.pyi @@ -1,6 +1,7 @@ from .general import ArrayAgg as ArrayAgg from .general import BitAnd as BitAnd from .general import BitOr as BitOr +from .general import BitXor as BitXor from .general import BoolAnd as BoolAnd from .general import BoolOr as BoolOr from .general import JSONBAgg as JSONBAgg diff --git a/django-stubs/contrib/postgres/aggregates/general.pyi b/django-stubs/contrib/postgres/aggregates/general.pyi index f42e82b8c..ee0841727 100644 --- a/django-stubs/contrib/postgres/aggregates/general.pyi +++ b/django-stubs/contrib/postgres/aggregates/general.pyi @@ -1,16 +1,30 @@ -from typing import ClassVar +from typing import Any, ClassVar from django.contrib.postgres.fields import ArrayField +from django.db.backends.base.base import BaseDatabaseWrapper from django.db.models import Aggregate, BooleanField, JSONField, TextField +from django.db.models.expressions import BaseExpression, Combinable +from django.db.models.sql.compiler import SQLCompiler, _AsSqlType +from typing_extensions import Self from .mixins import OrderableAggMixin class ArrayAgg(OrderableAggMixin, Aggregate): @property def output_field(self) -> ArrayField: ... + def resolve_expression( + self, + query: Any = ..., + allow_joins: bool = ..., + reuse: set[str] | None = ..., + summarize: bool = ..., + for_save: bool = ..., + ) -> Self: ... + def as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... # type: ignore[override] class BitAnd(Aggregate): ... class BitOr(Aggregate): ... +class BitXor(Aggregate): ... class BoolAnd(Aggregate): output_field: ClassVar[BooleanField] @@ -20,6 +34,28 @@ class BoolOr(Aggregate): class JSONBAgg(OrderableAggMixin, Aggregate): output_field: ClassVar[JSONField] + def __init__( + self, *expressions: BaseExpression | Combinable | str, default: Any | None = ..., **extra: Any + ) -> None: ... + def resolve_expression( + self, + query: Any = ..., + allow_joins: bool = ..., + reuse: set[str] | None = ..., + summarize: bool = ..., + for_save: bool = ..., + ) -> Self: ... + def as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... # type: ignore[override] class StringAgg(OrderableAggMixin, Aggregate): output_field: ClassVar[TextField] + def __init__(self, expression: BaseExpression | Combinable | str, delimiter: Any, **extra: Any) -> None: ... + def resolve_expression( + self, + query: Any = ..., + allow_joins: bool = ..., + reuse: set[str] | None = ..., + summarize: bool = ..., + for_save: bool = ..., + ) -> Self: ... + def as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... # type: ignore[override] diff --git a/django-stubs/contrib/postgres/aggregates/mixins.pyi b/django-stubs/contrib/postgres/aggregates/mixins.pyi index 538ba87c4..260612d54 100644 --- a/django-stubs/contrib/postgres/aggregates/mixins.pyi +++ b/django-stubs/contrib/postgres/aggregates/mixins.pyi @@ -1 +1,17 @@ -class OrderableAggMixin: ... +from collections.abc import Sequence +from typing import Any + +from django.db.backends.base.base import BaseDatabaseWrapper +from django.db.models.expressions import BaseExpression, Combinable, Expression, OrderByList +from django.db.models.sql.compiler import SQLCompiler, _AsSqlType +from typing_extensions import Self + +class OrderableAggMixin: + order_by: OrderByList + def __init__( + self, *expressions: BaseExpression | Combinable | str, ordering: Sequence[str] = ..., **extra: Any + ) -> None: ... + def resolve_expression(self, *args: Any, **kwargs: Any) -> Self: ... + def get_source_expressions(self) -> list[Expression]: ... + def set_source_expressions(self, exprs: Sequence[Combinable]) -> None: ... + def as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... diff --git a/django-stubs/contrib/postgres/aggregates/statistics.pyi b/django-stubs/contrib/postgres/aggregates/statistics.pyi index 986736af9..d5a449d1b 100644 --- a/django-stubs/contrib/postgres/aggregates/statistics.pyi +++ b/django-stubs/contrib/postgres/aggregates/statistics.pyi @@ -1,12 +1,20 @@ -from typing import ClassVar +from typing import Any, ClassVar from django.db.models import Aggregate, FloatField, IntegerField class StatAggregate(Aggregate): output_field: ClassVar[FloatField] + def __init__( + self, y: Any, x: Any, output_field: Any | None = ..., filter: Any | None = ..., default: Any | None = ... + ) -> None: ... class Corr(StatAggregate): ... -class CovarPop(StatAggregate): ... + +class CovarPop(StatAggregate): + def __init__( + self, y: Any, x: Any, sample: bool = ..., filter: Any | None = ..., default: Any | None = ... + ) -> None: ... + class RegrAvgX(StatAggregate): ... class RegrAvgY(StatAggregate): ... diff --git a/django-stubs/contrib/postgres/constraints.pyi b/django-stubs/contrib/postgres/constraints.pyi index a0c0d9f71..fbbf4646d 100644 --- a/django-stubs/contrib/postgres/constraints.pyi +++ b/django-stubs/contrib/postgres/constraints.pyi @@ -1,12 +1,18 @@ -from collections.abc import Sequence +from collections.abc import Iterable, Sequence +from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.models import Deferrable +from django.db.models.base import Model from django.db.models.constraints import BaseConstraint from django.db.models.expressions import Combinable +from django.db.models.indexes import IndexExpression from django.db.models.query_utils import Q from django.utils.functional import _StrOrPromise +class ExclusionConstraintExpression(IndexExpression): ... + class ExclusionConstraint(BaseConstraint): + template: str expressions: Sequence[tuple[str | Combinable, str]] index_type: str condition: Q | None @@ -19,7 +25,10 @@ class ExclusionConstraint(BaseConstraint): condition: Q | None = ..., deferrable: Deferrable | None = ..., include: list[str] | tuple[str] | None = ..., - opclasses: list[str] | tuple[str] = ..., violation_error_code: str | None = ..., violation_error_message: _StrOrPromise | None = ..., ) -> None: ... + def check_supported(self, schema_editor: BaseDatabaseSchemaEditor) -> None: ... + def validate( + self, model: type[Model], instance: Model, exclude: Iterable[str] | None = ..., using: str = ... + ) -> None: ... diff --git a/django-stubs/contrib/postgres/fields/array.pyi b/django-stubs/contrib/postgres/fields/array.pyi index 1cc80b100..b71faba3f 100644 --- a/django-stubs/contrib/postgres/fields/array.pyi +++ b/django-stubs/contrib/postgres/fields/array.pyi @@ -1,11 +1,14 @@ from collections.abc import Iterable, Sequence from typing import Any, TypeVar +from _typeshed import Unused from django.core.validators import _ValidatorCallable -from django.db.models import Field, Transform +from django.db.backends.base.base import BaseDatabaseWrapper +from django.db.models import Field from django.db.models.expressions import Combinable, Expression from django.db.models.fields import NOT_PROVIDED, _ErrorMessagesDict, _ErrorMessagesMapping from django.db.models.fields.mixins import CheckFieldDefaultMixin +from django.db.models.lookups import Transform from django.utils.choices import _Choices from django.utils.functional import _StrOrPromise @@ -55,4 +58,6 @@ class ArrayField(CheckFieldDefaultMixin, Field[_ST, _GT]): ) -> None: ... @property def description(self) -> str: ... # type: ignore[override] - def get_transform(self, name: Any) -> type[Transform] | None: ... + def cast_db_type(self, connection: BaseDatabaseWrapper) -> str: ... + def get_placeholder(self, value: Unused, compiler: Unused, connection: BaseDatabaseWrapper) -> str: ... + def get_transform(self, name: str) -> type[Transform] | None: ... diff --git a/django-stubs/contrib/postgres/fields/citext.pyi b/django-stubs/contrib/postgres/fields/citext.pyi index e0fbfcb5b..3f18bbeaa 100644 --- a/django-stubs/contrib/postgres/fields/citext.pyi +++ b/django-stubs/contrib/postgres/fields/citext.pyi @@ -1,6 +1,10 @@ +from django.db.backends.base.base import BaseDatabaseWrapper from django.db.models.fields import CharField, EmailField, TextField -class CIText: ... +class CIText: + def get_internal_type(self) -> str: ... + def db_type(self, connection: BaseDatabaseWrapper) -> str: ... + class CICharField(CIText, CharField): ... class CIEmailField(CIText, EmailField): ... class CITextField(CIText, TextField): ... diff --git a/django-stubs/contrib/postgres/fields/hstore.pyi b/django-stubs/contrib/postgres/fields/hstore.pyi index 179722afa..d0d2cac39 100644 --- a/django-stubs/contrib/postgres/fields/hstore.pyi +++ b/django-stubs/contrib/postgres/fields/hstore.pyi @@ -1,8 +1,10 @@ from typing import Any, ClassVar from django.contrib.postgres.fields.array import ArrayField +from django.db.backends.base.base import BaseDatabaseWrapper from django.db.models import Field, TextField, Transform from django.db.models.fields.mixins import CheckFieldDefaultMixin +from django.db.models.sql.compiler import SQLCompiler, _AsSqlType class HStoreField(CheckFieldDefaultMixin, Field): def get_transform(self, name: str) -> Any: ... @@ -11,6 +13,7 @@ class KeyTransform(Transform): output_field: ClassVar[TextField] def __init__(self, key_name: str, *args: Any, **kwargs: Any) -> None: ... + def as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... # type: ignore[override] class KeyTransformFactory: def __init__(self, key_name: str) -> None: ... diff --git a/django-stubs/contrib/postgres/fields/jsonb.pyi b/django-stubs/contrib/postgres/fields/jsonb.pyi index e18495261..ef0ecf9d5 100644 --- a/django-stubs/contrib/postgres/fields/jsonb.pyi +++ b/django-stubs/contrib/postgres/fields/jsonb.pyi @@ -1,8 +1,3 @@ from django.db.models import JSONField as BuiltinJSONField -from django.db.models.fields.json import KeyTextTransform as BuiltinKeyTextTransform -from django.db.models.fields.json import KeyTransform as BuiltinKeyTransform -# All deprecated class JSONField(BuiltinJSONField): ... -class KeyTransform(BuiltinKeyTransform): ... -class KeyTextTransform(BuiltinKeyTextTransform): ... diff --git a/django-stubs/contrib/postgres/fields/ranges.pyi b/django-stubs/contrib/postgres/fields/ranges.pyi index 886fa54eb..bea74c3fc 100644 --- a/django-stubs/contrib/postgres/fields/ranges.pyi +++ b/django-stubs/contrib/postgres/fields/ranges.pyi @@ -1,7 +1,11 @@ -from typing import Any, ClassVar, Literal +from typing import Any, ClassVar, Literal, TypeVar +from _typeshed import Unused +from django.contrib.postgres import forms from django.db import models +from django.db.backends.base.base import BaseDatabaseWrapper from django.db.models.lookups import PostgresOperatorLookup +from django.db.models.sql.compiler import SQLCompiler, _AsSqlType from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange, Range # type: ignore [import-untyped] class RangeBoundary(models.Expression): @@ -21,32 +25,41 @@ class RangeOperators: NOT_GT: Literal["&<"] ADJACENT_TO: Literal["-|-"] -class RangeField(models.Field): +_Range = TypeVar("_Range", bound=Range[Any]) + +class RangeField(models.Field[Any, _Range]): empty_strings_allowed: bool - base_field: models.Field - range_type: type[Range] + base_field: type[models.Field] + range_type: type[_Range] def get_prep_value(self, value: Any) -> Any | None: ... + def get_placeholder(self, value: Unused, compiler: Unused, connection: BaseDatabaseWrapper) -> str: ... def to_python(self, value: Any) -> Any: ... -class IntegerRangeField(RangeField): - def __get__(self, instance: Any, owner: Any) -> NumericRange: ... +class IntegerRangeField(RangeField[NumericRange]): + base_field: type[models.IntegerField] + form_field: type[forms.IntegerRangeField] -class BigIntegerRangeField(RangeField): - def __get__(self, instance: Any, owner: Any) -> NumericRange: ... +class BigIntegerRangeField(RangeField[NumericRange]): + base_field: type[models.BigIntegerField] + form_field: type[forms.IntegerRangeField] -class DecimalRangeField(RangeField): - def __get__(self, instance: Any, owner: Any) -> NumericRange: ... +class DecimalRangeField(RangeField[NumericRange]): + base_field: type[models.DecimalField] + form_field: type[forms.DecimalRangeField] -class DateTimeRangeField(RangeField): - def __get__(self, instance: Any, owner: Any) -> DateTimeTZRange: ... +class DateTimeRangeField(RangeField[DateTimeTZRange]): + base_field: type[models.DecimalField] + form_field: type[forms.DecimalRangeField] -class DateRangeField(RangeField): - def __get__(self, instance: Any, owner: Any) -> DateRange: ... +class DateRangeField(RangeField[DateRange]): + base_field: type[models.DateField] + form_field: type[forms.DateRangeField] class DateTimeRangeContains(PostgresOperatorLookup): ... class RangeContainedBy(PostgresOperatorLookup): type_mapping: dict[str, str] + def process_lhs(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... # type: ignore[override] class FullyLessThan(PostgresOperatorLookup): ... class FullGreaterThan(PostgresOperatorLookup): ... diff --git a/django-stubs/contrib/postgres/forms/__init__.pyi b/django-stubs/contrib/postgres/forms/__init__.pyi index 50446d589..e567b0ccb 100644 --- a/django-stubs/contrib/postgres/forms/__init__.pyi +++ b/django-stubs/contrib/postgres/forms/__init__.pyi @@ -1,4 +1,11 @@ -from .array import * -from .hstore import * -from .jsonb import * -from .ranges import * +from .array import SimpleArrayField as SimpleArrayField +from .array import SplitArrayField as SplitArrayField +from .array import SplitArrayWidget as SplitArrayWidget +from .hstore import HStoreField as HStoreField +from .ranges import BaseRangeField as BaseRangeField +from .ranges import DateRangeField as DateRangeField +from .ranges import DateTimeRangeField as DateTimeRangeField +from .ranges import DecimalRangeField as DecimalRangeField +from .ranges import HiddenRangeWidget as HiddenRangeWidget +from .ranges import IntegerRangeField as IntegerRangeField +from .ranges import RangeWidget as RangeWidget diff --git a/django-stubs/contrib/postgres/forms/jsonb.pyi b/django-stubs/contrib/postgres/forms/jsonb.pyi deleted file mode 100644 index 5262da9ee..000000000 --- a/django-stubs/contrib/postgres/forms/jsonb.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from typing import Any - -from django.forms import JSONField as BuiltinJSONField - -# Deprecated, removed in 4.0 -class JSONField(BuiltinJSONField): - def __init__(self, *args: Any, **kwargs: Any) -> None: ... diff --git a/django-stubs/contrib/postgres/lookups.pyi b/django-stubs/contrib/postgres/lookups.pyi index 6343c29ab..5aa6da193 100644 --- a/django-stubs/contrib/postgres/lookups.pyi +++ b/django-stubs/contrib/postgres/lookups.pyi @@ -1,5 +1,7 @@ +from django.db.backends.base.base import BaseDatabaseWrapper from django.db.models import Transform from django.db.models.lookups import PostgresOperatorLookup +from django.db.models.sql.compiler import SQLCompiler, _AsSqlType from .search import SearchVectorExact @@ -10,7 +12,10 @@ class HasKey(PostgresOperatorLookup): ... class HasKeys(PostgresOperatorLookup): ... class HasAnyKeys(HasKeys): ... class Unaccent(Transform): ... -class SearchLookup(SearchVectorExact): ... + +class SearchLookup(SearchVectorExact): + def process_lhs(self, qn: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... # type: ignore[override] + class TrigramSimilar(PostgresOperatorLookup): ... class TrigramWordSimilar(PostgresOperatorLookup): ... class TrigramStrictWordSimilar(PostgresOperatorLookup): ... diff --git a/django-stubs/contrib/postgres/search.pyi b/django-stubs/contrib/postgres/search.pyi index 1687a8a09..c90bdc110 100644 --- a/django-stubs/contrib/postgres/search.pyi +++ b/django-stubs/contrib/postgres/search.pyi @@ -1,13 +1,18 @@ from typing import Any, ClassVar +from django.db.backends.base.base import BaseDatabaseWrapper from django.db.models import Expression, Field, FloatField, TextField from django.db.models.expressions import Combinable, CombinedExpression, Func from django.db.models.lookups import Lookup +from django.db.models.sql.compiler import SQLCompiler, _AsSqlType from typing_extensions import Self, TypeAlias _Expression: TypeAlias = str | Combinable | SearchQueryCombinable -class SearchVectorExact(Lookup): ... +class SearchVectorExact(Lookup): + def process_rhs(self, qn: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... + def as_sql(self, qn: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... + class SearchVectorField(Field): ... class SearchQueryField(Field): ... @@ -28,6 +33,13 @@ class SearchVector(SearchVectorCombinable, Func): def __init__( self, *expressions: _Expression, config: _Expression | None = ..., weight: Any | None = ... ) -> None: ... + def as_sql( # type: ignore[override] + self, + compiler: SQLCompiler, + connection: BaseDatabaseWrapper, + function: str | None = ..., + template: str | None = ..., + ) -> _AsSqlType: ... class CombinedSearchVector(SearchVectorCombinable, CombinedExpression): def __init__( @@ -59,6 +71,13 @@ class SearchQuery(SearchQueryCombinable, Func): # type: ignore[misc] invert: bool = ..., search_type: str = ..., ) -> None: ... + def as_sql( # type: ignore[override] + self, + compiler: SQLCompiler, + connection: BaseDatabaseWrapper, + function: str | None = ..., + template: str | None = ..., + ) -> _AsSqlType: ... def __invert__(self) -> Self: ... # type: ignore[override] class CombinedSearchQuery(SearchQueryCombinable, CombinedExpression): # type: ignore[misc] @@ -101,6 +120,13 @@ class SearchHeadline(Func): max_fragments: int | None = ..., fragment_delimiter: str | None = ..., ) -> None: ... + def as_sql( # type: ignore[override] + self, + compiler: SQLCompiler, + connection: BaseDatabaseWrapper, + function: str | None = ..., + template: str | None = ..., + ) -> _AsSqlType: ... class TrigramBase(Func): output_field: ClassVar[FloatField] diff --git a/django-stubs/contrib/postgres/signals.pyi b/django-stubs/contrib/postgres/signals.pyi index f96766793..19d3c44bf 100644 --- a/django-stubs/contrib/postgres/signals.pyi +++ b/django-stubs/contrib/postgres/signals.pyi @@ -1,5 +1,6 @@ from typing import Any -def get_hstore_oids(connection_alias: str) -> tuple[Any, ...]: ... -def get_citext_oids(connection_alias: str) -> tuple[Any, ...]: ... +def get_type_oids(connection_alias: str, type_name: str) -> tuple[tuple[Any, ...], tuple[Any, ...]]: ... +def get_hstore_oids(connection_alias: str) -> tuple[tuple[Any, ...], tuple[Any, ...]]: ... +def get_citext_oids(connection_alias: str) -> tuple[tuple[Any, ...], tuple[Any, ...]]: ... def register_type_handlers(connection: Any, **kwargs: Any) -> None: ... diff --git a/django-stubs/db/models/aggregates.pyi b/django-stubs/db/models/aggregates.pyi index 2e00bca4a..1d9621764 100644 --- a/django-stubs/db/models/aggregates.pyi +++ b/django-stubs/db/models/aggregates.pyi @@ -8,6 +8,7 @@ class Aggregate(Func): filter_template: str filter: Any allow_distinct: bool + empty_result_set_value: int | None def __init__(self, *expressions: Any, distinct: bool = ..., filter: Any | None = ..., **extra: Any) -> None: ... class Avg(FixDurationInputMixin, NumericOutputFieldMixin, Aggregate): ... diff --git a/django-stubs/db/models/lookups.pyi b/django-stubs/db/models/lookups.pyi index 1babc04b1..d7462f4d9 100644 --- a/django-stubs/db/models/lookups.pyi +++ b/django-stubs/db/models/lookups.pyi @@ -71,8 +71,8 @@ class FieldGetDbPrepValueIterableMixin(FieldGetDbPrepValueMixin): self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, sql: str, param: Any ) -> _AsSqlType: ... -class PostgresOperatorLookup(FieldGetDbPrepValueMixin, Lookup[_T]): - postgres_operator: str +class PostgresOperatorLookup(Lookup[_T]): + postgres_operator: str | None def as_postgresql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... class Exact(FieldGetDbPrepValueMixin, BuiltinLookup[_T]): ... diff --git a/django-stubs/forms/widgets.pyi b/django-stubs/forms/widgets.pyi index 907f30eae..3ad2fc727 100644 --- a/django-stubs/forms/widgets.pyi +++ b/django-stubs/forms/widgets.pyi @@ -8,7 +8,7 @@ from django.forms.utils import _DataT, _FilesT from django.utils.choices import _Choices from django.utils.datastructures import _ListOrTuple from django.utils.safestring import SafeString -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias _OptAttrs: TypeAlias = dict[str, Any] @@ -40,6 +40,7 @@ class Widget(metaclass=MediaDefiningClass): attrs: _OptAttrs template_name: str def __init__(self, attrs: _OptAttrs | None = ...) -> None: ... + def __deepcopy__(self, memo: dict[int, Any]) -> Self: ... @property def is_hidden(self) -> bool: ... @property diff --git a/scripts/stubtest/allowlist_todo.txt b/scripts/stubtest/allowlist_todo.txt index ce7fdc3a7..086436f68 100644 --- a/scripts/stubtest/allowlist_todo.txt +++ b/scripts/stubtest/allowlist_todo.txt @@ -73,7 +73,6 @@ django.contrib.admin.widgets.AutocompleteMixin.media django.contrib.admin.widgets.BaseAdminDateWidget django.contrib.admin.widgets.BaseAdminTimeWidget django.contrib.admin.widgets.FilteredSelectMultiple.Media -django.contrib.admin.widgets.RelatedFieldWidgetWrapper.__deepcopy__ django.contrib.admin.widgets.get_select2_language django.contrib.admindocs.utils.non_capturing_group_matcher django.contrib.admindocs.utils.remove_non_capturing_groups @@ -245,7 +244,6 @@ django.contrib.gis.db.backends.spatialite.operations.SpatiaLiteOperations.rttopo django.contrib.gis.db.models.Aggregate.__init__ django.contrib.gis.db.models.Aggregate.as_sql django.contrib.gis.db.models.Aggregate.default_alias -django.contrib.gis.db.models.Aggregate.empty_result_set_value django.contrib.gis.db.models.Aggregate.name django.contrib.gis.db.models.AutoField.rel_db_type django.contrib.gis.db.models.BLANK_CHOICE_DASH @@ -262,7 +260,6 @@ django.contrib.gis.db.models.CharField.description django.contrib.gis.db.models.CharField.formfield django.contrib.gis.db.models.CheckConstraint.validate django.contrib.gis.db.models.Count.__init__ -django.contrib.gis.db.models.Count.empty_result_set_value django.contrib.gis.db.models.DEFERRED django.contrib.gis.db.models.DateField.contribute_to_class django.contrib.gis.db.models.DateField.formfield @@ -457,7 +454,6 @@ django.contrib.gis.forms.ModelFormMetaclass django.contrib.gis.forms.ModelFormOptions django.contrib.gis.forms.ModelMultipleChoiceField.hidden_widget django.contrib.gis.forms.MultiValueField.__deepcopy__ -django.contrib.gis.forms.MultiWidget.__deepcopy__ django.contrib.gis.forms.MultiWidget.use_fieldset django.contrib.gis.forms.MultipleChoiceField.hidden_widget django.contrib.gis.forms.PasswordInput.__slotnames__ @@ -467,7 +463,6 @@ django.contrib.gis.forms.SelectDateWidget.select_widget django.contrib.gis.forms.SelectDateWidget.use_fieldset django.contrib.gis.forms.SplitDateTimeField.hidden_widget django.contrib.gis.forms.TextInput.__slotnames__ -django.contrib.gis.forms.Widget.__deepcopy__ django.contrib.gis.forms.Widget.subwidgets django.contrib.gis.forms.Widget.use_fieldset django.contrib.gis.forms.formset_factory @@ -512,91 +507,16 @@ django.contrib.messages.storage.cookie.CookieStorage.key_salt django.contrib.messages.storage.cookie.MessageDecoder.decode django.contrib.messages.storage.cookie.MessageEncoder.default django.contrib.messages.storage.cookie.MessageSerializer -django.contrib.postgres.aggregates.CovarPop.__init__ -django.contrib.postgres.aggregates.JSONBAgg.__init__ -django.contrib.postgres.aggregates.RegrCount.empty_result_set_value -django.contrib.postgres.aggregates.StatAggregate.__init__ -django.contrib.postgres.aggregates.StringAgg.__init__ -django.contrib.postgres.aggregates.general.BitXor -django.contrib.postgres.aggregates.general.JSONBAgg.__init__ -django.contrib.postgres.aggregates.general.StringAgg.__init__ -django.contrib.postgres.aggregates.mixins.OrderableAggMixin.__init__ -django.contrib.postgres.aggregates.mixins.OrderableAggMixin.as_sql -django.contrib.postgres.aggregates.mixins.OrderableAggMixin.get_source_expressions -django.contrib.postgres.aggregates.mixins.OrderableAggMixin.resolve_expression -django.contrib.postgres.aggregates.mixins.OrderableAggMixin.set_source_expressions -django.contrib.postgres.aggregates.statistics.CovarPop.__init__ -django.contrib.postgres.aggregates.statistics.RegrCount.empty_result_set_value -django.contrib.postgres.aggregates.statistics.StatAggregate.__init__ -django.contrib.postgres.constraints.ExclusionConstraint.__init__ -django.contrib.postgres.constraints.ExclusionConstraint.check_supported -django.contrib.postgres.constraints.ExclusionConstraint.template -django.contrib.postgres.constraints.ExclusionConstraint.validate -django.contrib.postgres.fields.ArrayField.cast_db_type django.contrib.postgres.fields.ArrayField.formfield -django.contrib.postgres.fields.ArrayField.get_placeholder -django.contrib.postgres.fields.BigIntegerRangeField.__get__ -django.contrib.postgres.fields.BigIntegerRangeField.base_field -django.contrib.postgres.fields.BigIntegerRangeField.form_field django.contrib.postgres.fields.CIText.__init__ -django.contrib.postgres.fields.CIText.db_type -django.contrib.postgres.fields.CIText.get_internal_type -django.contrib.postgres.fields.DateRangeField.__get__ -django.contrib.postgres.fields.DateRangeField.base_field -django.contrib.postgres.fields.DateRangeField.form_field -django.contrib.postgres.fields.DateTimeRangeField.__get__ -django.contrib.postgres.fields.DateTimeRangeField.base_field -django.contrib.postgres.fields.DateTimeRangeField.form_field -django.contrib.postgres.fields.DecimalRangeField.__get__ -django.contrib.postgres.fields.DecimalRangeField.base_field -django.contrib.postgres.fields.DecimalRangeField.form_field django.contrib.postgres.fields.HStoreField.formfield -django.contrib.postgres.fields.IntegerRangeField.__get__ -django.contrib.postgres.fields.IntegerRangeField.base_field -django.contrib.postgres.fields.IntegerRangeField.form_field django.contrib.postgres.fields.RangeField.formfield -django.contrib.postgres.fields.RangeField.get_placeholder -django.contrib.postgres.fields.array.ArrayField.cast_db_type django.contrib.postgres.fields.array.ArrayField.formfield -django.contrib.postgres.fields.array.ArrayField.get_placeholder django.contrib.postgres.fields.citext.CIText.__init__ -django.contrib.postgres.fields.citext.CIText.db_type -django.contrib.postgres.fields.citext.CIText.get_internal_type django.contrib.postgres.fields.hstore.HStoreField.formfield -django.contrib.postgres.fields.hstore.KeyTransform.as_sql -django.contrib.postgres.fields.jsonb.KeyTextTransform -django.contrib.postgres.fields.jsonb.KeyTransform -django.contrib.postgres.fields.ranges.BigIntegerRangeField.__get__ -django.contrib.postgres.fields.ranges.BigIntegerRangeField.base_field -django.contrib.postgres.fields.ranges.BigIntegerRangeField.form_field -django.contrib.postgres.fields.ranges.DateRangeField.__get__ -django.contrib.postgres.fields.ranges.DateRangeField.base_field -django.contrib.postgres.fields.ranges.DateRangeField.form_field -django.contrib.postgres.fields.ranges.DateTimeRangeField.__get__ -django.contrib.postgres.fields.ranges.DateTimeRangeField.base_field -django.contrib.postgres.fields.ranges.DateTimeRangeField.form_field -django.contrib.postgres.fields.ranges.DecimalRangeField.__get__ -django.contrib.postgres.fields.ranges.DecimalRangeField.base_field -django.contrib.postgres.fields.ranges.DecimalRangeField.form_field -django.contrib.postgres.fields.ranges.IntegerRangeField.__get__ -django.contrib.postgres.fields.ranges.IntegerRangeField.base_field -django.contrib.postgres.fields.ranges.IntegerRangeField.form_field -django.contrib.postgres.fields.ranges.RangeContainedBy.process_lhs django.contrib.postgres.fields.ranges.RangeField.formfield -django.contrib.postgres.fields.ranges.RangeField.get_placeholder django.contrib.postgres.forms.BaseRangeField.hidden_widget -django.contrib.postgres.forms.JSONField -django.contrib.postgres.forms.SplitArrayWidget.__deepcopy__ -django.contrib.postgres.forms.array.SplitArrayWidget.__deepcopy__ -django.contrib.postgres.forms.jsonb django.contrib.postgres.forms.ranges.BaseRangeField.hidden_widget -django.contrib.postgres.lookups.SearchLookup.process_lhs -django.contrib.postgres.search.SearchHeadline.as_sql -django.contrib.postgres.search.SearchQuery.as_sql -django.contrib.postgres.search.SearchVector.as_sql -django.contrib.postgres.search.SearchVectorExact.as_sql -django.contrib.postgres.search.SearchVectorExact.process_rhs -django.contrib.postgres.signals.get_type_oids django.contrib.redirects.admin.RedirectAdmin django.contrib.redirects.models.Redirect.id django.contrib.redirects.models.Redirect.new_path @@ -778,7 +698,6 @@ django.db.migrations.utils.resolve_relation django.db.models.Aggregate.__init__ django.db.models.Aggregate.as_sql django.db.models.Aggregate.default_alias -django.db.models.Aggregate.empty_result_set_value django.db.models.Aggregate.name django.db.models.AutoField.rel_db_type django.db.models.BLANK_CHOICE_DASH @@ -795,7 +714,6 @@ django.db.models.CharField.description django.db.models.CharField.formfield django.db.models.CheckConstraint.validate django.db.models.Count.__init__ -django.db.models.Count.empty_result_set_value django.db.models.DEFERRED django.db.models.DateField.contribute_to_class django.db.models.DateField.formfield @@ -944,10 +862,8 @@ django.db.models.Window.as_sqlite django.db.models.aggregates.Aggregate.__init__ django.db.models.aggregates.Aggregate.as_sql django.db.models.aggregates.Aggregate.default_alias -django.db.models.aggregates.Aggregate.empty_result_set_value django.db.models.aggregates.Aggregate.name django.db.models.aggregates.Count.__init__ -django.db.models.aggregates.Count.empty_result_set_value django.db.models.aggregates.StdDev.__init__ django.db.models.aggregates.Variance.__init__ django.db.models.base.DEFERRED @@ -1225,7 +1141,6 @@ django.db.models.lookups.Lookup.relabeled_clone django.db.models.lookups.Lookup.resolve_expression django.db.models.lookups.Lookup.select_format django.db.models.lookups.PatternLookup.process_rhs -django.db.models.lookups.PostgresOperatorLookup.postgres_operator django.db.models.manager.BaseManager.aaggregate django.db.models.manager.BaseManager.abulk_create django.db.models.manager.BaseManager.abulk_update @@ -1439,7 +1354,6 @@ django.forms.ModelFormMetaclass django.forms.ModelFormOptions django.forms.ModelMultipleChoiceField.hidden_widget django.forms.MultiValueField.__deepcopy__ -django.forms.MultiWidget.__deepcopy__ django.forms.MultiWidget.use_fieldset django.forms.MultipleChoiceField.hidden_widget django.forms.PasswordInput.__slotnames__ @@ -1449,7 +1363,6 @@ django.forms.SelectDateWidget.select_widget django.forms.SelectDateWidget.use_fieldset django.forms.SplitDateTimeField.hidden_widget django.forms.TextInput.__slotnames__ -django.forms.Widget.__deepcopy__ django.forms.Widget.subwidgets django.forms.Widget.use_fieldset django.forms.boundfield.BoundWidget.__html__ @@ -1485,7 +1398,6 @@ django.forms.models.inlineformset_factory django.forms.models.modelform_factory django.forms.models.modelformset_factory django.forms.renderers.DjangoDivFormRenderer -django.forms.widgets.ChoiceWidget.__deepcopy__ django.forms.widgets.ChoiceWidget.subwidgets django.forms.widgets.ChoiceWidget.template_name django.forms.widgets.EmailInput.__slotnames__ @@ -1494,7 +1406,6 @@ django.forms.widgets.HiddenInput.__slotnames__ django.forms.widgets.Input.input_type django.forms.widgets.Media.__html__ django.forms.widgets.MediaDefiningClass.__new__ -django.forms.widgets.MultiWidget.__deepcopy__ django.forms.widgets.MultiWidget.use_fieldset django.forms.widgets.PasswordInput.__slotnames__ django.forms.widgets.RadioSelect.id_for_label @@ -1502,7 +1413,6 @@ django.forms.widgets.RadioSelect.use_fieldset django.forms.widgets.SelectDateWidget.select_widget django.forms.widgets.SelectDateWidget.use_fieldset django.forms.widgets.TextInput.__slotnames__ -django.forms.widgets.Widget.__deepcopy__ django.forms.widgets.Widget.subwidgets django.forms.widgets.Widget.use_fieldset django.http.HttpHeaders diff --git a/tests/typecheck/test_import_all.yml b/tests/typecheck/test_import_all.yml index 5234ae7ad..19c14a472 100644 --- a/tests/typecheck/test_import_all.yml +++ b/tests/typecheck/test_import_all.yml @@ -253,7 +253,6 @@ import django.contrib.postgres.forms import django.contrib.postgres.forms.array import django.contrib.postgres.forms.hstore - import django.contrib.postgres.forms.jsonb import django.contrib.postgres.forms.ranges import django.contrib.postgres.functions import django.contrib.postgres.indexes