Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/aiterator-async-iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
john-parton authored Aug 16, 2024
2 parents d40f097 + 79fd3f9 commit 547be49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions django-stubs/db/models/fields/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ from typing_extensions import Literal, Self

from django.core.checks import CheckMessage
from django.core.exceptions import FieldDoesNotExist as FieldDoesNotExist
from django.db.models import Model
from django.db.models import Model, TextChoices
from django.db.models.expressions import Col, Combinable
from django.db.models.query_utils import RegisterLookupMixin
from django.forms import Widget
Expand Down Expand Up @@ -679,7 +679,8 @@ class CharField(Generic[_C], Field[_C | Combinable, _C]):
unique_for_date: str | None = ...,
unique_for_month: str | None = ...,
unique_for_year: str | None = ...,
choices: Iterable[tuple[_C, str] | tuple[str, Iterable[tuple[_C, str]]]] = ...,
choices: Iterable[tuple[_C, str] | tuple[str, Iterable[tuple[_C, str]]]]
| type[TextChoices] = ...,
help_text: str = ...,
db_column: str | None = ...,
db_comment: str | None = ...,
Expand All @@ -706,7 +707,8 @@ class CharField(Generic[_C], Field[_C | Combinable, _C]):
unique_for_date: str | None = ...,
unique_for_month: str | None = ...,
unique_for_year: str | None = ...,
choices: Iterable[tuple[_C, str] | tuple[str, Iterable[tuple[_C, str]]]] = ...,
choices: Iterable[tuple[_C, str] | tuple[str, Iterable[tuple[_C, str]]]]
| type[TextChoices] = ...,
help_text: str = ...,
db_column: str | None = ...,
db_comment: str | None = ...,
Expand Down
6 changes: 4 additions & 2 deletions django-stubs/db/models/fields/json.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
from collections.abc import Callable, Iterable
from typing import Any, TypeVar, overload
from typing_extensions import Literal
from typing_extensions import Literal, Self

from django.db.models import lookups
from django.db.models.expressions import Combinable
Expand Down Expand Up @@ -135,6 +135,8 @@ class KeyTransform(Transform):
class KeyTextTransform(KeyTransform):
postgres_operator: str = ...
postgres_nested_operator: str = ...
@classmethod
def from_lookup(cls, lookup: str) -> Self: ...

class KeyTransformTextLookupMixin:
def __init__(self, key_transform: Any, *args: Any, **kwargs: Any) -> None: ...
Expand Down Expand Up @@ -187,4 +189,4 @@ class KeyTransformFactory:
def __init__(self, key_name: Any) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...

KT: KeyTextTransform = ...
KT = KeyTextTransform.from_lookup

0 comments on commit 547be49

Please sign in to comment.