Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.0: Update django.db.models.lookups #2103

Merged
merged 2 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions django-stubs/db/models/lookups.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from collections.abc import Iterable, Mapping
from typing import Any, Generic, Literal, TypeVar

from django.core.exceptions import EmptyResultSet
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.models.expressions import Expression, Func
from django.db.models.fields import BooleanField
Expand Down Expand Up @@ -82,12 +83,20 @@ class GreaterThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup[_T]): ...
class LessThan(FieldGetDbPrepValueMixin, BuiltinLookup[_T]): ...
class LessThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup[_T]): ...

class IntegerFieldOverflow:
underflow_exception: type[EmptyResultSet]
overflow_exception: type[EmptyResultSet]
def process_rhs(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ...

class IntegerFieldFloatRounding:
rhs: Any
def get_prep_lookup(self) -> Any: ...

class IntegerGreaterThanOrEqual(IntegerFieldFloatRounding, GreaterThanOrEqual[int | float]): ...
class IntegerLessThan(IntegerFieldFloatRounding, LessThan[int | float]): ...
class IntegerFieldExact(IntegerFieldOverflow, Exact[int | float]): ...
class IntegerGreaterThan(IntegerFieldOverflow, GreaterThan[int | float]): ...
class IntegerGreaterThanOrEqual(IntegerFieldOverflow, IntegerFieldFloatRounding, GreaterThanOrEqual[int | float]): ...
class IntegerLessThan(IntegerFieldOverflow, IntegerFieldFloatRounding, LessThan[int | float]): ...
class IntegerLessThanOrEqual(IntegerFieldOverflow, LessThanOrEqual[int | float]): ...

class In(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
def split_parameter_list_as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> Any: ...
Expand Down
6 changes: 0 additions & 6 deletions scripts/stubtest/allowlist_todo_django50.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ django.db.models.functions.Collate.allowed_default
django.db.models.functions.Now.as_oracle
django.db.models.functions.comparison.Collate.allowed_default
django.db.models.functions.datetime.Now.as_oracle
django.db.models.lookups.IntegerFieldExact
django.db.models.lookups.IntegerFieldOverflow
django.db.models.lookups.IntegerGreaterThan
django.db.models.lookups.IntegerGreaterThanOrEqual.underflow_exception
django.db.models.lookups.IntegerLessThan.overflow_exception
django.db.models.lookups.IntegerLessThanOrEqual
django.db.models.lookups.Lookup.allowed_default
django.db.models.query.Prefetch.get_current_querysets
django.db.models.query_utils.FilteredRelation.relabeled_clone
Expand Down
Loading