From a08e67361c3f21e9561e1434715d4de058037fb4 Mon Sep 17 00:00:00 2001 From: fidoriel <49869342+fidoriel@users.noreply.github.com> Date: Tue, 30 Jan 2024 07:22:45 +0100 Subject: [PATCH 1/3] fix: #1924 --- django-stubs/db/models/query.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/django-stubs/db/models/query.pyi b/django-stubs/db/models/query.pyi index 6f449bf77..9facaa43d 100644 --- a/django-stubs/db/models/query.pyi +++ b/django-stubs/db/models/query.pyi @@ -178,7 +178,6 @@ class _QuerySet(Generic[_T, _Row], Collection[_Row], Reversible[_Row], Sized): def resolve_expression(self, *args: Any, **kwargs: Any) -> Any: ... def __iter__(self) -> Iterator[_Row]: ... def __aiter__(self) -> AsyncIterator[_Row]: ... - def __contains__(self, x: object) -> bool: ... @overload def __getitem__(self, i: int) -> _Row: ... @overload From 5acb64ef866d259932cc16dbbeb2b5b9afe1658d Mon Sep 17 00:00:00 2001 From: fidoriel <49869342+fidoriel@users.noreply.github.com> Date: Tue, 30 Jan 2024 08:58:40 +0100 Subject: [PATCH 2/3] change collection to iterable --- django-stubs/db/models/query.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-stubs/db/models/query.pyi b/django-stubs/db/models/query.pyi index 9facaa43d..3f20f1b80 100644 --- a/django-stubs/db/models/query.pyi +++ b/django-stubs/db/models/query.pyi @@ -43,7 +43,7 @@ class NamedValuesListIterable(ValuesListIterable[NamedTuple]): class FlatValuesListIterable(BaseIterable[_Row]): def __iter__(self) -> Iterator[_Row]: ... -class _QuerySet(Generic[_T, _Row], Collection[_Row], Reversible[_Row], Sized): +class _QuerySet(Generic[_T, _Row], Reversible[_Row], Iterable[_Row], Sized): model: type[_T] query: Query _iterable_class: type[BaseIterable] From 08ca4f300f19c7c38ad9dc4ca8ef6c758a30d7be Mon Sep 17 00:00:00 2001 From: fidoriel <49869342+fidoriel@users.noreply.github.com> Date: Tue, 30 Jan 2024 09:29:28 +0100 Subject: [PATCH 3/3] fix allow list --- scripts/stubtest/allowlist_todo.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/stubtest/allowlist_todo.txt b/scripts/stubtest/allowlist_todo.txt index 72a8467b5..95bbe0ab7 100644 --- a/scripts/stubtest/allowlist_todo.txt +++ b/scripts/stubtest/allowlist_todo.txt @@ -436,7 +436,6 @@ django.contrib.gis.db.models.Q.__init__ django.contrib.gis.db.models.Q.check django.contrib.gis.db.models.Q.flatten django.contrib.gis.db.models.Q.resolve_expression -django.contrib.gis.db.models.QuerySet.__contains__ django.contrib.gis.db.models.QuerySet.__deepcopy__ django.contrib.gis.db.models.QuerySet.__reversed__ django.contrib.gis.db.models.QuerySet.__xor__ @@ -1014,7 +1013,6 @@ django.db.models.Q.__init__ django.db.models.Q.check django.db.models.Q.flatten django.db.models.Q.resolve_expression -django.db.models.QuerySet.__contains__ django.db.models.QuerySet.__deepcopy__ django.db.models.QuerySet.__reversed__ django.db.models.QuerySet.__xor__ @@ -1408,7 +1406,6 @@ django.db.models.options.Options.local_concrete_fields django.db.models.options.Options.many_to_many django.db.models.options.Options.related_objects django.db.models.query.EmptyQuerySet.__init__ -django.db.models.query.QuerySet.__contains__ django.db.models.query.QuerySet.__deepcopy__ django.db.models.query.QuerySet.__reversed__ django.db.models.query.QuerySet.__xor__