Skip to content

Commit

Permalink
Adding missing Q methods: check(), flatten() (#1899)
Browse files Browse the repository at this point in the history
Co-authored-by: Victorien <[email protected]>
  • Loading branch information
Alexerson and Viicos authored Mar 20, 2024
1 parent 31df882 commit a13f68e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 3 additions & 0 deletions django-stubs/db/models/query_utils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ from collections import namedtuple
from collections.abc import Collection, Iterable, Iterator, Mapping, Sequence
from typing import Any, ClassVar, Literal, TypeVar

from _typeshed import Incomplete
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.models.base import Model
from django.db.models.expressions import BaseExpression
Expand Down Expand Up @@ -40,6 +41,8 @@ class Q(tree.Node):
summarize: bool = ...,
for_save: bool = ...,
) -> WhereNode: ...
def flatten(self) -> Iterator[Incomplete]: ...
def check(self, against: dict[str, Any], using: str = ...) -> bool: ...
def deconstruct(self) -> tuple[str, Sequence[Any], dict[str, Any]]: ...

class DeferredAttribute:
Expand Down
6 changes: 0 additions & 6 deletions scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,6 @@ django.contrib.gis.db.models.PositiveIntegerField.integer_field_class
django.contrib.gis.db.models.PositiveSmallIntegerField.formfield
django.contrib.gis.db.models.PositiveSmallIntegerField.integer_field_class
django.contrib.gis.db.models.Q.XOR
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__
Expand Down Expand Up @@ -969,8 +967,6 @@ django.db.models.PositiveIntegerField.integer_field_class
django.db.models.PositiveSmallIntegerField.formfield
django.db.models.PositiveSmallIntegerField.integer_field_class
django.db.models.Q.XOR
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__
Expand Down Expand Up @@ -1362,8 +1358,6 @@ django.db.models.query.prefetch_one_level
django.db.models.query_utils.DeferredAttribute.__get__
django.db.models.query_utils.InvalidQuery
django.db.models.query_utils.Q.XOR
django.db.models.query_utils.Q.check
django.db.models.query_utils.Q.flatten
django.db.models.query_utils.Q.resolve_expression
django.db.models.query_utils.RegisterLookupMixin._unregister_lookup
django.db.models.query_utils.RegisterLookupMixin.get_class_lookups
Expand Down

0 comments on commit a13f68e

Please sign in to comment.