mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-02-24 18:48:52 +08:00
move generated stubs to separate directory, too messty
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
from .array import * # NOQA
|
||||
from .jsonb import * # NOQA
|
||||
from .ranges import * # NOQA
|
||||
97
django-stubs-generated/contrib/postgres/fields/array.pyi
Normal file
97
django-stubs-generated/contrib/postgres/fields/array.pyi
Normal file
@@ -0,0 +1,97 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union, TypeVar, Type, Generic
|
||||
|
||||
from django.contrib.postgres import lookups
|
||||
from django.db.models import Field, Transform
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.lookups import Exact, In
|
||||
|
||||
from .mixins import CheckFieldDefaultMixin
|
||||
|
||||
_T = TypeVar('_T', bound=Field)
|
||||
|
||||
|
||||
class ArrayField(CheckFieldDefaultMixin, Field, Generic[_T]):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
base_field: Any = ...
|
||||
size: Any = ...
|
||||
default_validators: Any = ...
|
||||
from_db_value: Any = ...
|
||||
|
||||
def __init__(
|
||||
self, base_field: _T, size: None = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
@property
|
||||
def model(self): ...
|
||||
@model.setter
|
||||
def model(self, model: Any) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def set_attributes_from_name(self, name: str) -> None: ...
|
||||
@property
|
||||
def description(self): ...
|
||||
def db_type(self, connection: Any): ...
|
||||
def get_db_prep_value(
|
||||
self, value: Any, connection: Any, prepared: bool = ...
|
||||
): ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
None, str, List[Any], Dict[str, Optional[Union[bool, Field]]]
|
||||
]: ...
|
||||
def to_python(self, value: Any): ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
def get_transform(self, name: Any): ...
|
||||
def validate(self, value: Any, model_instance: Any) -> None: ...
|
||||
def run_validators(self, value: Any) -> None: ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
def __get__(self, instance, owner) -> List[_T]: ...
|
||||
|
||||
class ArrayContains(lookups.DataContains):
|
||||
def as_sql(self, qn: Any, connection: Any): ...
|
||||
|
||||
class ArrayContainedBy(lookups.ContainedBy):
|
||||
def as_sql(self, qn: Any, connection: Any): ...
|
||||
|
||||
class ArrayExact(Exact):
|
||||
def as_sql(self, qn: Any, connection: Any): ...
|
||||
|
||||
class ArrayOverlap(lookups.Overlap):
|
||||
def as_sql(self, qn: Any, connection: Any): ...
|
||||
|
||||
class ArrayLenTransform(Transform):
|
||||
lookup_name: str = ...
|
||||
output_field: Any = ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class ArrayInLookup(In):
|
||||
def get_prep_lookup(self): ...
|
||||
|
||||
class IndexTransform(Transform):
|
||||
index: Any = ...
|
||||
base_field: Any = ...
|
||||
def __init__(
|
||||
self, index: Any, base_field: Any, *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
@property
|
||||
def output_field(self): ...
|
||||
|
||||
class IndexTransformFactory:
|
||||
index: Any = ...
|
||||
base_field: Any = ...
|
||||
def __init__(self, index: Any, base_field: Any) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any): ...
|
||||
|
||||
class SliceTransform(Transform):
|
||||
start: Any = ...
|
||||
end: Any = ...
|
||||
def __init__(
|
||||
self, start: Any, end: Any, *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class SliceTransformFactory:
|
||||
start: Any = ...
|
||||
end: Any = ...
|
||||
def __init__(self, start: Any, end: Any) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any): ...
|
||||
89
django-stubs-generated/contrib/postgres/fields/jsonb.pyi
Normal file
89
django-stubs-generated/contrib/postgres/fields/jsonb.pyi
Normal file
@@ -0,0 +1,89 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from psycopg2.extras import Json
|
||||
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.db.models import Field, Transform
|
||||
from django.db.models import lookups as builtin_lookups
|
||||
|
||||
from .mixins import CheckFieldDefaultMixin
|
||||
|
||||
|
||||
class JsonAdapter(Json):
|
||||
encoder: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
adapted: Any,
|
||||
dumps: Optional[Any] = ...,
|
||||
encoder: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def dumps(self, obj: Any): ...
|
||||
|
||||
class JSONField(CheckFieldDefaultMixin, Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
description: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
encoder: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: None = ...,
|
||||
name: None = ...,
|
||||
encoder: Optional[Type[DjangoJSONEncoder]] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def db_type(self, connection: Any): ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
None, str, List[Any], Dict[str, Union[Type[DjangoJSONEncoder], bool]]
|
||||
]: ...
|
||||
def get_transform(self, name: Any): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def validate(self, value: Any, model_instance: Any) -> None: ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
|
||||
class KeyTransform(Transform):
|
||||
operator: str = ...
|
||||
nested_operator: str = ...
|
||||
key_name: Any = ...
|
||||
def __init__(self, key_name: Any, *args: Any, **kwargs: Any) -> None: ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class KeyTextTransform(KeyTransform):
|
||||
operator: str = ...
|
||||
nested_operator: str = ...
|
||||
output_field: Any = ...
|
||||
|
||||
class KeyTransformTextLookupMixin:
|
||||
def __init__(
|
||||
self, key_transform: Any, *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
class KeyTransformIExact(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.IExact
|
||||
): ...
|
||||
class KeyTransformIContains(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.IContains
|
||||
): ...
|
||||
class KeyTransformStartsWith(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.StartsWith
|
||||
): ...
|
||||
class KeyTransformIStartsWith(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.IStartsWith
|
||||
): ...
|
||||
class KeyTransformEndsWith(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.EndsWith
|
||||
): ...
|
||||
class KeyTransformIEndsWith(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.IEndsWith
|
||||
): ...
|
||||
class KeyTransformRegex(KeyTransformTextLookupMixin, builtin_lookups.Regex): ...
|
||||
class KeyTransformIRegex(
|
||||
KeyTransformTextLookupMixin, builtin_lookups.IRegex
|
||||
): ...
|
||||
|
||||
class KeyTransformFactory:
|
||||
key_name: Any = ...
|
||||
def __init__(self, key_name: Any) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any): ...
|
||||
@@ -0,0 +1,5 @@
|
||||
from typing import Any, List, Optional
|
||||
|
||||
|
||||
class CheckFieldDefaultMixin:
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
98
django-stubs-generated/contrib/postgres/fields/ranges.pyi
Normal file
98
django-stubs-generated/contrib/postgres/fields/ranges.pyi
Normal file
@@ -0,0 +1,98 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.postgres import lookups
|
||||
from django.db import models
|
||||
|
||||
|
||||
class RangeField(models.Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
base_field: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
@property
|
||||
def model(self): ...
|
||||
@model.setter
|
||||
def model(self, model: Any) -> None: ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def set_attributes_from_name(self, name: str) -> None: ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
|
||||
class IntegerRangeField(RangeField):
|
||||
base_field: Any = ...
|
||||
range_type: Any = ...
|
||||
form_field: Any = ...
|
||||
def db_type(self, connection: Any): ...
|
||||
|
||||
class BigIntegerRangeField(RangeField):
|
||||
base_field: Any = ...
|
||||
range_type: Any = ...
|
||||
form_field: Any = ...
|
||||
def db_type(self, connection: Any): ...
|
||||
|
||||
class FloatRangeField(RangeField):
|
||||
base_field: Any = ...
|
||||
range_type: Any = ...
|
||||
form_field: Any = ...
|
||||
def db_type(self, connection: Any): ...
|
||||
|
||||
class DateTimeRangeField(RangeField):
|
||||
base_field: Any = ...
|
||||
range_type: Any = ...
|
||||
form_field: Any = ...
|
||||
def db_type(self, connection: Any): ...
|
||||
|
||||
class DateRangeField(RangeField):
|
||||
base_field: Any = ...
|
||||
range_type: Any = ...
|
||||
form_field: Any = ...
|
||||
def db_type(self, connection: Any): ...
|
||||
|
||||
class DateTimeRangeContains(models.Lookup):
|
||||
lookup_name: str = ...
|
||||
rhs: Any = ...
|
||||
def process_rhs(self, compiler: Any, connection: Any): ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class RangeContainedBy(models.Lookup):
|
||||
lookup_name: str = ...
|
||||
type_mapping: Any = ...
|
||||
def as_sql(self, qn: Any, connection: Any): ...
|
||||
def get_prep_lookup(self): ...
|
||||
|
||||
class FullyLessThan(lookups.PostgresSimpleLookup):
|
||||
lookup_name: str = ...
|
||||
operator: str = ...
|
||||
|
||||
class FullGreaterThan(lookups.PostgresSimpleLookup):
|
||||
lookup_name: str = ...
|
||||
operator: str = ...
|
||||
|
||||
class NotLessThan(lookups.PostgresSimpleLookup):
|
||||
lookup_name: str = ...
|
||||
operator: str = ...
|
||||
|
||||
class NotGreaterThan(lookups.PostgresSimpleLookup):
|
||||
lookup_name: str = ...
|
||||
operator: str = ...
|
||||
|
||||
class AdjacentToLookup(lookups.PostgresSimpleLookup):
|
||||
lookup_name: str = ...
|
||||
operator: str = ...
|
||||
|
||||
class RangeStartsWith(models.Transform):
|
||||
lookup_name: str = ...
|
||||
function: str = ...
|
||||
@property
|
||||
def output_field(self): ...
|
||||
|
||||
class RangeEndsWith(models.Transform):
|
||||
lookup_name: str = ...
|
||||
function: str = ...
|
||||
@property
|
||||
def output_field(self): ...
|
||||
|
||||
class IsEmpty(models.Transform):
|
||||
lookup_name: str = ...
|
||||
function: str = ...
|
||||
output_field: Any = ...
|
||||
51
django-stubs-generated/contrib/postgres/operations.pyi
Normal file
51
django-stubs-generated/contrib/postgres/operations.pyi
Normal file
@@ -0,0 +1,51 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.migrations.operations.base import Operation
|
||||
from django.db.migrations.state import ProjectState
|
||||
|
||||
|
||||
class CreateExtension(Operation):
|
||||
reversible: bool = ...
|
||||
name: Any = ...
|
||||
def __init__(self, name: str) -> None: ...
|
||||
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
|
||||
def database_forwards(
|
||||
self,
|
||||
app_label: str,
|
||||
schema_editor: DatabaseSchemaEditor,
|
||||
from_state: ProjectState,
|
||||
to_state: ProjectState,
|
||||
) -> None: ...
|
||||
def database_backwards(
|
||||
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
|
||||
) -> None: ...
|
||||
def describe(self): ...
|
||||
|
||||
class BtreeGinExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class BtreeGistExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class CITextExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class CryptoExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class HStoreExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class TrigramExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class UnaccentExtension(CreateExtension):
|
||||
name: str = ...
|
||||
def __init__(self) -> None: ...
|
||||
Reference in New Issue
Block a user