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

KT is a function, not an instance. #260

Merged
Merged
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
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
Loading