mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 22:11:54 +08:00
add django 3.1 jsonfield
This commit is contained in:
@@ -60,6 +60,7 @@ from .fields.files import (
|
|||||||
FileDescriptor as FileDescriptor,
|
FileDescriptor as FileDescriptor,
|
||||||
)
|
)
|
||||||
from .fields.proxy import OrderWrt as OrderWrt
|
from .fields.proxy import OrderWrt as OrderWrt
|
||||||
|
from .fields.json import JSONField as JSONField
|
||||||
|
|
||||||
from .deletion import (
|
from .deletion import (
|
||||||
CASCADE as CASCADE,
|
CASCADE as CASCADE,
|
||||||
|
|||||||
@@ -2,103 +2,43 @@ from . import Field
|
|||||||
from .mixins import CheckFieldDefaultMixin
|
from .mixins import CheckFieldDefaultMixin
|
||||||
from django.db.models import lookups
|
from django.db.models import lookups
|
||||||
from django.db.models.lookups import PostgresOperatorLookup, Transform
|
from django.db.models.lookups import PostgresOperatorLookup, Transform
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional, Callable
|
||||||
|
|
||||||
|
|
||||||
class JSONField(CheckFieldDefaultMixin, Field):
|
class JSONField(CheckFieldDefaultMixin, Field):
|
||||||
empty_strings_allowed: bool = ...
|
|
||||||
description: Any = ...
|
|
||||||
default_error_messages: Any = ...
|
|
||||||
encoder: Any = ...
|
|
||||||
decoder: Any = ...
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
verbose_name: Optional[Any] = ...,
|
verbose_name: Optional[str] = ...,
|
||||||
name: Optional[Any] = ...,
|
name: Optional[str] = ...,
|
||||||
encoder: Optional[Any] = ...,
|
encoder: Optional[Callable] = ...,
|
||||||
decoder: Optional[Any] = ...,
|
decoder: Optional[Callable] = ...,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def check(self, **kwargs: Any): ...
|
|
||||||
def deconstruct(self): ...
|
|
||||||
def from_db_value(self, value: Any, expression: Any, connection: Any): ...
|
|
||||||
def get_internal_type(self): ...
|
|
||||||
def get_prep_value(self, value: Any): ...
|
|
||||||
def get_transform(self, name: Any): ...
|
|
||||||
def validate(self, value: Any, model_instance: Any) -> None: ...
|
|
||||||
def value_to_string(self, obj: Any): ...
|
def value_to_string(self, obj: Any): ...
|
||||||
def formfield(self, **kwargs: Any): ...
|
|
||||||
|
|
||||||
class DataContains(PostgresOperatorLookup):
|
class DataContains(PostgresOperatorLookup): ...
|
||||||
lookup_name: str = ...
|
class ContainedBy(PostgresOperatorLookup): ...
|
||||||
postgres_operator: str = ...
|
|
||||||
def as_sql(self, compiler: Any, connection: Any): ...
|
|
||||||
|
|
||||||
class ContainedBy(PostgresOperatorLookup):
|
class HasKeyLookup(PostgresOperatorLookup): ...
|
||||||
lookup_name: str = ...
|
class HasKey(HasKeyLookup): ...
|
||||||
postgres_operator: str = ...
|
class HasKeys(HasKeyLookup): ...
|
||||||
def as_sql(self, compiler: Any, connection: Any): ...
|
class HasAnyKeys(HasKeys): ...
|
||||||
|
class JSONExact(lookups.Exact): ...
|
||||||
class HasKeyLookup(PostgresOperatorLookup):
|
|
||||||
logical_operator: Any = ...
|
|
||||||
def as_sql(self, compiler: Any, connection: Any, template: Optional[Any] = ...): ...
|
|
||||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
|
||||||
def as_oracle(self, compiler: Any, connection: Any): ...
|
|
||||||
lhs: Any = ...
|
|
||||||
rhs: Any = ...
|
|
||||||
def as_postgresql(self, compiler: Any, connection: Any): ...
|
|
||||||
def as_sqlite(self, compiler: Any, connection: Any): ...
|
|
||||||
|
|
||||||
class HasKey(HasKeyLookup):
|
|
||||||
lookup_name: str = ...
|
|
||||||
postgres_operator: str = ...
|
|
||||||
prepare_rhs: bool = ...
|
|
||||||
|
|
||||||
class HasKeys(HasKeyLookup):
|
|
||||||
lookup_name: str = ...
|
|
||||||
postgres_operator: str = ...
|
|
||||||
logical_operator: str = ...
|
|
||||||
def get_prep_lookup(self): ...
|
|
||||||
|
|
||||||
class HasAnyKeys(HasKeys):
|
|
||||||
lookup_name: str = ...
|
|
||||||
postgres_operator: str = ...
|
|
||||||
logical_operator: str = ...
|
|
||||||
|
|
||||||
class JSONExact(lookups.Exact):
|
|
||||||
can_use_none_as_rhs: bool = ...
|
|
||||||
def process_rhs(self, compiler: Any, connection: Any): ...
|
|
||||||
|
|
||||||
class KeyTransform(Transform):
|
class KeyTransform(Transform):
|
||||||
postgres_operator: str = ...
|
|
||||||
postgres_nested_operator: str = ...
|
|
||||||
key_name: Any = ...
|
key_name: Any = ...
|
||||||
def __init__(self, key_name: Any, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, key_name: Any, *args: Any, **kwargs: Any) -> None: ...
|
||||||
def preprocess_lhs(self, compiler: Any, connection: Any, lhs_only: bool = ...): ...
|
def preprocess_lhs(self, compiler: Any, connection: Any, lhs_only: bool = ...): ...
|
||||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
|
||||||
def as_oracle(self, compiler: Any, connection: Any): ...
|
|
||||||
def as_postgresql(self, compiler: Any, connection: Any): ...
|
|
||||||
|
|
||||||
class KeyTextTransform(KeyTransform):
|
|
||||||
postgres_operator: str = ...
|
|
||||||
postgres_nested_operator: str = ...
|
|
||||||
|
|
||||||
|
class KeyTextTransform(KeyTransform): ...
|
||||||
class KeyTransformTextLookupMixin:
|
class KeyTransformTextLookupMixin:
|
||||||
def __init__(self, key_transform: Any, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, key_transform: Any, *args: Any, **kwargs: Any) -> None: ...
|
||||||
|
|
||||||
class CaseInsensitiveMixin:
|
class CaseInsensitiveMixin: ...
|
||||||
def process_rhs(self, compiler: Any, connection: Any): ...
|
class KeyTransformIsNull(lookups.IsNull): ...
|
||||||
|
class KeyTransformIn(lookups.In): ...
|
||||||
class KeyTransformIsNull(lookups.IsNull):
|
|
||||||
def as_oracle(self, compiler: Any, connection: Any): ...
|
|
||||||
def as_sqlite(self, compiler: Any, connection: Any): ...
|
|
||||||
|
|
||||||
class KeyTransformIn(lookups.In):
|
|
||||||
def process_rhs(self, compiler: Any, connection: Any): ...
|
|
||||||
|
|
||||||
class KeyTransformExact(JSONExact):
|
|
||||||
def process_rhs(self, compiler: Any, connection: Any): ...
|
|
||||||
def as_oracle(self, compiler: Any, connection: Any): ...
|
|
||||||
|
|
||||||
|
class KeyTransformExact(JSONExact): ...
|
||||||
class KeyTransformIExact(CaseInsensitiveMixin, KeyTransformTextLookupMixin, lookups.IExact): ...
|
class KeyTransformIExact(CaseInsensitiveMixin, KeyTransformTextLookupMixin, lookups.IExact): ...
|
||||||
class KeyTransformIContains(CaseInsensitiveMixin, KeyTransformTextLookupMixin, lookups.IContains): ...
|
class KeyTransformIContains(CaseInsensitiveMixin, KeyTransformTextLookupMixin, lookups.IContains): ...
|
||||||
class KeyTransformStartsWith(KeyTransformTextLookupMixin, lookups.StartsWith): ...
|
class KeyTransformStartsWith(KeyTransformTextLookupMixin, lookups.StartsWith): ...
|
||||||
@@ -108,9 +48,7 @@ class KeyTransformIEndsWith(CaseInsensitiveMixin, KeyTransformTextLookupMixin, l
|
|||||||
class KeyTransformRegex(KeyTransformTextLookupMixin, lookups.Regex): ...
|
class KeyTransformRegex(KeyTransformTextLookupMixin, lookups.Regex): ...
|
||||||
class KeyTransformIRegex(CaseInsensitiveMixin, KeyTransformTextLookupMixin, lookups.IRegex): ...
|
class KeyTransformIRegex(CaseInsensitiveMixin, KeyTransformTextLookupMixin, lookups.IRegex): ...
|
||||||
|
|
||||||
class KeyTransformNumericLookupMixin:
|
class KeyTransformNumericLookupMixin: ...
|
||||||
def process_rhs(self, compiler: Any, connection: Any): ...
|
|
||||||
|
|
||||||
class KeyTransformLt(KeyTransformNumericLookupMixin, lookups.LessThan): ...
|
class KeyTransformLt(KeyTransformNumericLookupMixin, lookups.LessThan): ...
|
||||||
class KeyTransformLte(KeyTransformNumericLookupMixin, lookups.LessThanOrEqual): ...
|
class KeyTransformLte(KeyTransformNumericLookupMixin, lookups.LessThanOrEqual): ...
|
||||||
class KeyTransformGt(KeyTransformNumericLookupMixin, lookups.GreaterThan): ...
|
class KeyTransformGt(KeyTransformNumericLookupMixin, lookups.GreaterThan): ...
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class FieldGetDbPrepValueIterableMixin(FieldGetDbPrepValueMixin):
|
|||||||
) -> Any: ...
|
) -> Any: ...
|
||||||
|
|
||||||
class PostgresOperatorLookup(FieldGetDbPrepValueMixin, Lookup):
|
class PostgresOperatorLookup(FieldGetDbPrepValueMixin, Lookup):
|
||||||
postgres_operator: Any = ...
|
postgres_operator: str = ...
|
||||||
def as_postgresql(self, compiler: Any, connection: Any): ...
|
def as_postgresql(self, compiler: Any, connection: Any): ...
|
||||||
|
|
||||||
class Exact(FieldGetDbPrepValueMixin, BuiltinLookup): ...
|
class Exact(FieldGetDbPrepValueMixin, BuiltinLookup): ...
|
||||||
|
|||||||
Reference in New Issue
Block a user