mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 05:24:53 +08:00
move generated stubs to separate directory, too messty
This commit is contained in:
573
django-stubs-generated/db/models/fields/__init__.pyi
Normal file
573
django-stubs-generated/db/models/fields/__init__.pyi
Normal file
@@ -0,0 +1,573 @@
|
||||
from datetime import date, datetime, time, timedelta
|
||||
from decimal import Context, Decimal
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.validators import DecimalValidator
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Col, CombinedExpression
|
||||
from django.db.models.fields import reverse_related
|
||||
from django.db.models.fields.files import FieldFile
|
||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import RegisterLookupMixin
|
||||
from django.db.models.sql.compiler import SQLCompiler, SQLInsertCompiler
|
||||
from django.forms.fields import (BooleanField, DurationField, EmailField,
|
||||
Field, FloatField, TypedMultipleChoiceField)
|
||||
from django.utils.datastructures import DictWrapper
|
||||
|
||||
|
||||
class Empty: ...
|
||||
class NOT_PROVIDED: ...
|
||||
|
||||
BLANK_CHOICE_DASH: Any
|
||||
|
||||
class Field(RegisterLookupMixin):
|
||||
empty_strings_allowed: bool = ...
|
||||
empty_values: Any = ...
|
||||
creation_counter: int = ...
|
||||
auto_creation_counter: int = ...
|
||||
default_validators: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
system_check_deprecated_details: Any = ...
|
||||
system_check_removed_details: Any = ...
|
||||
hidden: bool = ...
|
||||
many_to_many: Any = ...
|
||||
many_to_one: Any = ...
|
||||
one_to_many: Any = ...
|
||||
one_to_one: Any = ...
|
||||
related_model: Any = ...
|
||||
description: Any = ...
|
||||
name: Any = ...
|
||||
verbose_name: Any = ...
|
||||
primary_key: Any = ...
|
||||
remote_field: Any = ...
|
||||
is_relation: Any = ...
|
||||
default: Any = ...
|
||||
editable: Any = ...
|
||||
serialize: Any = ...
|
||||
unique_for_date: Any = ...
|
||||
unique_for_month: Any = ...
|
||||
unique_for_year: Any = ...
|
||||
choices: Any = ...
|
||||
help_text: Any = ...
|
||||
db_index: Any = ...
|
||||
db_column: Any = ...
|
||||
auto_created: Any = ...
|
||||
error_messages: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[str] = ...,
|
||||
name: Optional[str] = ...,
|
||||
primary_key: bool = ...,
|
||||
max_length: Optional[int] = ...,
|
||||
unique: bool = ...,
|
||||
blank: bool = ...,
|
||||
null: bool = ...,
|
||||
db_index: bool = ...,
|
||||
rel: Optional[ForeignObjectRel] = ...,
|
||||
default: Any = ...,
|
||||
editable: bool = ...,
|
||||
serialize: bool = ...,
|
||||
unique_for_date: None = ...,
|
||||
unique_for_month: None = ...,
|
||||
unique_for_year: None = ...,
|
||||
choices: Optional[
|
||||
Union[
|
||||
List[List[Union[List[List[str]], str]]],
|
||||
List[Tuple[Optional[int], str]],
|
||||
List[Tuple[Union[int, str], int]],
|
||||
Tuple[Tuple[Union[int, str], Union[int, str]]],
|
||||
]
|
||||
] = ...,
|
||||
help_text: str = ...,
|
||||
db_column: Optional[str] = ...,
|
||||
db_tablespace: Optional[str] = ...,
|
||||
auto_created: bool = ...,
|
||||
validators: Union[List[Callable], Tuple] = ...,
|
||||
error_messages: None = ...,
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def get_col(
|
||||
self,
|
||||
alias: str,
|
||||
output_field: Optional[
|
||||
Union[Field, reverse_related.ForeignObjectRel]
|
||||
] = ...,
|
||||
) -> Col: ...
|
||||
def cached_col(self) -> Col: ...
|
||||
def select_format(
|
||||
self, compiler: SQLCompiler, sql: str, params: List[Union[int, str]]
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str], str, List[Any], Dict[str, List[Tuple[int, str]]]
|
||||
]: ...
|
||||
def clone(self) -> Field: ...
|
||||
def __eq__(self, other: Field) -> bool: ...
|
||||
def __lt__(self, other: Field) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __deepcopy__(self, memodict: Dict[int, Dict[Any, Any]]) -> Field: ...
|
||||
def __copy__(self) -> Field: ...
|
||||
def __reduce__(self): ...
|
||||
def get_pk_value_on_save(self, instance: Model) -> Optional[UUID]: ...
|
||||
def to_python(self, value: FieldFile) -> FieldFile: ...
|
||||
def validators(self) -> List[Callable]: ...
|
||||
def run_validators(self, value: Any) -> None: ...
|
||||
def validate(self, value: Any, model_instance: Optional[Model]) -> None: ...
|
||||
def clean(self, value: Any, model_instance: Optional[Model]) -> Any: ...
|
||||
def db_type_parameters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> DictWrapper: ...
|
||||
def db_check(self, connection: DatabaseWrapper) -> None: ...
|
||||
def db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
def cast_db_type(self, connection: Any): ...
|
||||
def db_parameters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> Dict[str, Optional[str]]: ...
|
||||
def db_type_suffix(self, connection: DatabaseWrapper) -> Optional[str]: ...
|
||||
def get_db_converters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> List[Callable]: ...
|
||||
@property
|
||||
def unique(self) -> bool: ...
|
||||
@property
|
||||
def db_tablespace(self) -> str: ...
|
||||
concrete: Any = ...
|
||||
def set_attributes_from_name(self, name: str) -> None: ...
|
||||
model: Any = ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, private_only: bool = ...
|
||||
) -> None: ...
|
||||
def get_filter_kwargs_for_object(self, obj: Any): ...
|
||||
def get_attname(self) -> str: ...
|
||||
def get_attname_column(self) -> Tuple[str, str]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def pre_save(self, model_instance: Model, add: bool) -> Any: ...
|
||||
def get_prep_value(self, value: Any) -> Any: ...
|
||||
def get_db_prep_value(
|
||||
self, value: Any, connection: DatabaseWrapper, prepared: bool = ...
|
||||
) -> Optional[Union[bytes, float, str]]: ...
|
||||
def get_db_prep_save(
|
||||
self, value: Any, connection: DatabaseWrapper
|
||||
) -> Optional[Union[float, str]]: ...
|
||||
def has_default(self) -> bool: ...
|
||||
def get_default(self) -> Any: ...
|
||||
def get_choices(
|
||||
self,
|
||||
include_blank: bool = ...,
|
||||
blank_choice: List[Tuple[str, str]] = ...,
|
||||
limit_choices_to: Optional[Dict[str, QuerySet]] = ...,
|
||||
) -> List[
|
||||
Tuple[
|
||||
Union[int, str], Union[Tuple[Tuple[str, str], Tuple[str, str]], str]
|
||||
]
|
||||
]: ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
flatchoices: Any = ...
|
||||
def save_form_data(
|
||||
self, instance: Model, data: Optional[Union[date, Model, float, str]]
|
||||
) -> None: ...
|
||||
def formfield(
|
||||
self,
|
||||
form_class: Optional[Type[Field]] = ...,
|
||||
choices_form_class: Optional[Type[TypedMultipleChoiceField]] = ...,
|
||||
**kwargs: Any
|
||||
) -> Field: ...
|
||||
def value_from_object(self, obj: Model) -> Any: ...
|
||||
|
||||
class AutoField(Field):
|
||||
description: Any = ...
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, Union[bool, str]]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Union[int, str]) -> int: ...
|
||||
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
def validate(self, value: Any, model_instance: Any) -> None: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Union[int, str],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Union[int, str]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[int, str]]
|
||||
) -> Optional[int]: ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> None: ...
|
||||
def formfield(self, **kwargs: Any) -> None: ...
|
||||
def __get__(self, instance, owner) -> int: ...
|
||||
|
||||
class BigAutoField(AutoField):
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
|
||||
class BooleanField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Optional[Union[bool, str]]) -> bool: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[bool, str]]
|
||||
) -> Optional[bool]: ...
|
||||
def formfield(self, **kwargs: Any) -> BooleanField: ...
|
||||
|
||||
class CharField(Field):
|
||||
description: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def cast_db_type(self, connection: Any): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[Model, int, str]]
|
||||
) -> Optional[str]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[Model, str]]
|
||||
) -> Optional[str]: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
def __get__(self, instance, owner) -> str: ...
|
||||
|
||||
class CommaSeparatedIntegerField(CharField):
|
||||
default_validators: Any = ...
|
||||
description: Any = ...
|
||||
system_check_removed_details: Any = ...
|
||||
|
||||
class DateTimeCheckMixin:
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
|
||||
class DateField(DateTimeCheckMixin, Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[str] = ...,
|
||||
name: None = ...,
|
||||
auto_now: bool = ...,
|
||||
auto_now_add: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str], str, List[Any], Dict[str, Union[Callable, int, str]]
|
||||
]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[date, str]]
|
||||
) -> Optional[date]: ...
|
||||
def pre_save(
|
||||
self, model_instance: Model, add: bool
|
||||
) -> Optional[Union[date, CombinedExpression]]: ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> None: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[date, str]]
|
||||
) -> Optional[date]: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Optional[date],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Optional[str]: ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
|
||||
class DateTimeField(DateField):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[datetime, str]]
|
||||
) -> Optional[datetime]: ...
|
||||
def pre_save(
|
||||
self, model_instance: Model, add: bool
|
||||
) -> Optional[Union[datetime, CombinedExpression]]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[datetime]
|
||||
) -> Optional[datetime]: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Optional[datetime],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Optional[str]: ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
|
||||
class DecimalField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: None = ...,
|
||||
name: None = ...,
|
||||
max_digits: Optional[int] = ...,
|
||||
decimal_places: Optional[int] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def validators(self) -> List[DecimalValidator]: ...
|
||||
def context(self) -> Context: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, int]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Optional[str]) -> Optional[Decimal]: ...
|
||||
def get_db_prep_save(
|
||||
self, value: Optional[str], connection: DatabaseWrapper
|
||||
) -> Optional[str]: ...
|
||||
def get_prep_value(self, value: None) -> None: ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
|
||||
class DurationField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: str) -> timedelta: ...
|
||||
def get_db_prep_value(
|
||||
self, value: Any, connection: Any, prepared: bool = ...
|
||||
): ...
|
||||
def get_db_converters(self, connection: Any): ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
def formfield(self, **kwargs: Any) -> DurationField: ...
|
||||
|
||||
class EmailField(CharField):
|
||||
default_validators: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, int]]: ...
|
||||
def formfield(self, **kwargs: Any) -> EmailField: ...
|
||||
|
||||
class FilePathField(Field):
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
path: str = ...,
|
||||
match: Optional[Any] = ...,
|
||||
recursive: bool = ...,
|
||||
allow_files: bool = ...,
|
||||
allow_folders: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any): ...
|
||||
def deconstruct(self): ...
|
||||
def get_prep_value(self, value: Optional[str]) -> Optional[str]: ...
|
||||
def get_internal_type(self): ...
|
||||
|
||||
class FloatField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_prep_value(self, value: Union[float, str]) -> float: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Union[float, str]) -> float: ...
|
||||
def formfield(self, **kwargs: Any) -> FloatField: ...
|
||||
|
||||
class IntegerField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def validators(self) -> List[Any]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[int, str]]
|
||||
) -> Optional[int]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Union[int, str]) -> int: ...
|
||||
|
||||
class BigIntegerField(IntegerField):
|
||||
empty_strings_allowed: bool = ...
|
||||
description: Any = ...
|
||||
MAX_BIGINT: int = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class IPAddressField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
description: Any = ...
|
||||
system_check_removed_details: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def deconstruct(self) -> Tuple[None, str, List[Any], Dict[str, bool]]: ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class GenericIPAddressField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
description: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
unpack_ipv4: Any = ...
|
||||
protocol: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
protocol: str = ...,
|
||||
unpack_ipv4: bool = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any): ...
|
||||
def deconstruct(self): ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Union[Callable, int, str]) -> str: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Optional[str],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Optional[str]: ...
|
||||
def get_prep_value(self, value: Optional[str]) -> Optional[str]: ...
|
||||
|
||||
class NullBooleanField(BooleanField):
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def deconstruct(self): ...
|
||||
def get_internal_type(self): ...
|
||||
|
||||
class PositiveIntegerRelDbTypeMixin:
|
||||
def rel_db_type(self, connection: Any): ...
|
||||
|
||||
class PositiveIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField):
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField):
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class SlugField(CharField):
|
||||
default_validators: Any = ...
|
||||
description: Any = ...
|
||||
allow_unicode: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
*args: Any,
|
||||
max_length: int = ...,
|
||||
db_index: bool = ...,
|
||||
allow_unicode: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, int]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class SmallIntegerField(IntegerField):
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class TextField(Field):
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[Dict[Any, Any], int, str]]
|
||||
) -> Optional[str]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[Dict[Any, Any], int, str]]
|
||||
) -> Optional[str]: ...
|
||||
|
||||
class TimeField(DateTimeCheckMixin, Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: None = ...,
|
||||
name: None = ...,
|
||||
auto_now: bool = ...,
|
||||
auto_now_add: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[Any, Any]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[datetime, str]]
|
||||
) -> Optional[time]: ...
|
||||
def pre_save(
|
||||
self, model_instance: Model, add: bool
|
||||
) -> Optional[datetime]: ...
|
||||
def get_prep_value(self, value: Optional[datetime]) -> Optional[time]: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Optional[datetime],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Optional[str]: ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
|
||||
class URLField(CharField):
|
||||
default_validators: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self, verbose_name: None = ..., name: None = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, int]]: ...
|
||||
|
||||
class BinaryField(Field):
|
||||
description: Any = ...
|
||||
empty_values: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, bool]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def get_placeholder(
|
||||
self,
|
||||
value: None,
|
||||
compiler: SQLInsertCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
) -> str: ...
|
||||
def get_default(self) -> bytes: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Optional[bytes],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> None: ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
def to_python(self, value: Any): ...
|
||||
|
||||
class UUIDField(Field):
|
||||
default_error_messages: Any = ...
|
||||
description: str = ...
|
||||
empty_strings_allowed: bool = ...
|
||||
def __init__(self, verbose_name: None = ..., **kwargs: Any) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str], str, List[Any], Dict[str, Union[Callable, bool]]
|
||||
]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Optional[Union[Dict[Any, Any], List[Any]]],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> None: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[Dict[Any, Any], List[Any], UUID]]
|
||||
) -> Optional[UUID]: ...
|
||||
116
django-stubs-generated/db/models/fields/files.pyi
Normal file
116
django-stubs-generated/db/models/fields/files.pyi
Normal file
@@ -0,0 +1,116 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.core.checks.messages import Error
|
||||
from django.core.files.base import File
|
||||
from django.core.files.images import ImageFile
|
||||
from django.core.files.storage import FileSystemStorage, Storage
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import Field
|
||||
from django.forms.fields import FileField, ImageField
|
||||
|
||||
|
||||
class FieldFile(File):
|
||||
instance: django.db.models.base.Model = ...
|
||||
field: django.db.models.fields.files.FileField = ...
|
||||
storage: django.core.files.storage.FileSystemStorage = ...
|
||||
def __init__(
|
||||
self, instance: Model, field: FileField, name: Optional[str]
|
||||
) -> None: ...
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
def __hash__(self): ...
|
||||
file: Any = ...
|
||||
@property
|
||||
def path(self) -> str: ...
|
||||
@property
|
||||
def url(self) -> str: ...
|
||||
@property
|
||||
def size(self) -> int: ...
|
||||
def open(self, mode: str = ...) -> FieldFile: ...
|
||||
name: Optional[str] = ...
|
||||
def save(self, name: str, content: File, save: bool = ...) -> None: ...
|
||||
def delete(self, save: bool = ...) -> None: ...
|
||||
@property
|
||||
def closed(self) -> bool: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
class FileDescriptor:
|
||||
field: django.db.models.fields.files.FileField = ...
|
||||
def __init__(self, field: FileField) -> None: ...
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Union[FieldFile, FileDescriptor]: ...
|
||||
def __set__(
|
||||
self, instance: Model, value: Optional[Union[File, str]]
|
||||
) -> None: ...
|
||||
|
||||
class FileField(Field):
|
||||
attr_class: Any = ...
|
||||
descriptor_class: Any = ...
|
||||
description: Any = ...
|
||||
storage: Any = ...
|
||||
upload_to: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[str] = ...,
|
||||
name: None = ...,
|
||||
upload_to: Union[Callable, str] = ...,
|
||||
storage: Optional[Storage] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, Union[bool, str]]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def get_prep_value(self, value: Union[FieldFile, str]) -> str: ...
|
||||
def pre_save(self, model_instance: Model, add: bool) -> FieldFile: ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> None: ...
|
||||
def generate_filename(
|
||||
self, instance: Optional[Model], filename: str
|
||||
) -> str: ...
|
||||
def save_form_data(
|
||||
self, instance: Model, data: Optional[Union[bool, File, str]]
|
||||
) -> None: ...
|
||||
def formfield(self, **kwargs: Any) -> FileField: ...
|
||||
|
||||
class ImageFileDescriptor(FileDescriptor):
|
||||
field: django.db.models.fields.files.ImageField
|
||||
def __set__(self, instance: Model, value: Optional[str]) -> None: ...
|
||||
|
||||
class ImageFieldFile(ImageFile, FieldFile):
|
||||
field: django.db.models.fields.files.ImageField
|
||||
instance: django.db.models.base.Model
|
||||
name: Optional[str]
|
||||
storage: django.core.files.storage.DefaultStorage
|
||||
def delete(self, save: bool = ...) -> None: ...
|
||||
|
||||
class ImageField(FileField):
|
||||
attr_class: Any = ...
|
||||
descriptor_class: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: None = ...,
|
||||
name: None = ...,
|
||||
width_field: Optional[str] = ...,
|
||||
height_field: Optional[str] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str],
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, bool, FileSystemStorage, str]],
|
||||
]: ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> None: ...
|
||||
def update_dimension_fields(
|
||||
self, instance: Model, force: bool = ..., *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def formfield(self, **kwargs: Any) -> ImageField: ...
|
||||
16
django-stubs-generated/db/models/fields/mixins.pyi
Normal file
16
django-stubs-generated/db/models/fields/mixins.pyi
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.models.base import Model
|
||||
|
||||
NOT_PROVIDED: Any
|
||||
|
||||
class FieldCacheMixin:
|
||||
def get_cache_name(self) -> None: ...
|
||||
def get_cached_value(
|
||||
self, instance: Model, default: Any = ...
|
||||
) -> Optional[Model]: ...
|
||||
def is_cached(self, instance: Model) -> bool: ...
|
||||
def set_cached_value(
|
||||
self, instance: Model, value: Optional[Model]
|
||||
) -> None: ...
|
||||
def delete_cached_value(self, instance: Model) -> None: ...
|
||||
7
django-stubs-generated/db/models/fields/proxy.pyi
Normal file
7
django-stubs-generated/db/models/fields/proxy.pyi
Normal file
@@ -0,0 +1,7 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.models import fields
|
||||
|
||||
|
||||
class OrderWrt(fields.IntegerField):
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
325
django-stubs-generated/db/models/fields/related.pyi
Normal file
325
django-stubs-generated/db/models/fields/related.pyi
Normal file
@@ -0,0 +1,325 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.checks.messages import Error, Warning
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Col
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.fields.related_lookups import RelatedIsNull
|
||||
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
||||
ManyToManyRel,
|
||||
ManyToOneRel, OneToOneRel)
|
||||
from django.db.models.lookups import FieldGetDbPrepValueMixin
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import PathInfo, Q
|
||||
from django.db.models.sql.where import WhereNode
|
||||
from django.forms.fields import Field
|
||||
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
|
||||
|
||||
from . import Field
|
||||
from .mixins import FieldCacheMixin
|
||||
from .related_descriptors import (ForwardManyToOneDescriptor as ForwardManyToOneDescriptor,
|
||||
ForwardOneToOneDescriptor as ForwardOneToOneDescriptor,
|
||||
ManyToManyDescriptor as ManyToManyDescriptor,
|
||||
ReverseManyToOneDescriptor as ReverseManyToOneDescriptor,
|
||||
ReverseOneToOneDescriptor as ReverseOneToOneDescriptor)
|
||||
from .related_lookups import (RelatedExact, RelatedGreaterThan,
|
||||
RelatedGreaterThanOrEqual, RelatedIn,
|
||||
RelatedIsNull, RelatedLessThan,
|
||||
RelatedLessThanOrEqual)
|
||||
from .reverse_related import (ForeignObjectRel, ManyToManyRel, ManyToOneRel,
|
||||
OneToOneRel)
|
||||
|
||||
RECURSIVE_RELATIONSHIP_CONSTANT: str
|
||||
|
||||
def resolve_relation(
|
||||
scope_model: Type[Model], relation: Union[Type[Model], str]
|
||||
) -> Union[Type[Model], str]: ...
|
||||
def lazy_related_operation(
|
||||
function: Callable, model: Type[Model], *related_models: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
class RelatedField(FieldCacheMixin, Field):
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
def related_model(self) -> Union[Type[Model], str]: ...
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
def db_type(self, connection: DatabaseWrapper) -> None: ...
|
||||
opts: Any = ...
|
||||
def contribute_to_class(
|
||||
self,
|
||||
cls: Type[Model],
|
||||
name: str,
|
||||
private_only: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, str]]: ...
|
||||
def get_forward_related_filter(
|
||||
self, obj: Model
|
||||
) -> Dict[str, Union[int, UUID]]: ...
|
||||
def get_reverse_related_filter(self, obj: Model) -> Q: ...
|
||||
@property
|
||||
def swappable_setting(self) -> Optional[str]: ...
|
||||
name: Any = ...
|
||||
verbose_name: Any = ...
|
||||
def set_attributes_from_rel(self) -> None: ...
|
||||
def do_related_class(
|
||||
self, other: Type[Model], cls: Type[Model]
|
||||
) -> None: ...
|
||||
def get_limit_choices_to(self) -> Dict[str, int]: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
def related_query_name(self) -> str: ...
|
||||
@property
|
||||
def target_field(self) -> Field: ...
|
||||
def get_cache_name(self) -> str: ...
|
||||
|
||||
class ForeignObject(RelatedField):
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
requires_unique_target: bool = ...
|
||||
related_accessor_class: Any = ...
|
||||
forward_related_accessor_class: Any = ...
|
||||
rel_class: Any = ...
|
||||
from_fields: Any = ...
|
||||
to_fields: Any = ...
|
||||
swappable: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
to: Union[Type[Model], str],
|
||||
on_delete: Callable,
|
||||
from_fields: Union[List[str], Tuple[str, str]],
|
||||
to_fields: Union[List[None], List[str], Tuple[str, str]],
|
||||
rel: Optional[ForeignObjectRel] = ...,
|
||||
related_name: None = ...,
|
||||
related_query_name: None = ...,
|
||||
limit_choices_to: None = ...,
|
||||
parent_link: bool = ...,
|
||||
swappable: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str],
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Any],
|
||||
]: ...
|
||||
def resolve_related_fields(self) -> List[Tuple[Field, Field]]: ...
|
||||
@property
|
||||
def related_fields(self) -> List[Tuple[Field, Field]]: ...
|
||||
@property
|
||||
def reverse_related_fields(self) -> List[Tuple[Field, Field]]: ...
|
||||
@property
|
||||
def local_related_fields(self) -> Tuple[Field]: ...
|
||||
@property
|
||||
def foreign_related_fields(self) -> Tuple[Field]: ...
|
||||
def get_local_related_value(
|
||||
self, instance: Model
|
||||
) -> Tuple[Optional[int]]: ...
|
||||
def get_foreign_related_value(
|
||||
self, instance: Model
|
||||
) -> Tuple[Optional[int]]: ...
|
||||
@staticmethod
|
||||
def get_instance_value_for_fields(
|
||||
instance: Model, fields: Tuple[Field]
|
||||
) -> Tuple[Optional[int]]: ...
|
||||
def get_attname_column(self) -> Tuple[str, None]: ...
|
||||
def get_joining_columns(
|
||||
self, reverse_join: bool = ...
|
||||
) -> Tuple[Tuple[str, str]]: ...
|
||||
def get_reverse_joining_columns(self) -> Tuple: ...
|
||||
def get_extra_descriptor_filter(
|
||||
self, instance: Model
|
||||
) -> Dict[Any, Any]: ...
|
||||
def get_extra_restriction(
|
||||
self, where_class: Type[WhereNode], alias: str, related_alias: str
|
||||
) -> None: ...
|
||||
def get_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def get_reverse_path_info(self, filtered_relation: Optional[Any] = ...): ...
|
||||
@classmethod
|
||||
def get_lookups(
|
||||
cls
|
||||
) -> Dict[str, Type[Union[RelatedIsNull, FieldGetDbPrepValueMixin]]]: ...
|
||||
def contribute_to_class(
|
||||
self,
|
||||
cls: Type[Model],
|
||||
name: str,
|
||||
private_only: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def contribute_to_related_class(
|
||||
self, cls: Type[Model], related: ForeignObjectRel
|
||||
) -> None: ...
|
||||
|
||||
class ForeignKey(ForeignObject):
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
rel_class: Any = ...
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
db_constraint: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
to: Union[Type[Model], str],
|
||||
on_delete: Callable,
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: None = ...,
|
||||
limit_choices_to: Optional[
|
||||
Union[Callable, Dict[str, Union[int, str]]]
|
||||
] = ...,
|
||||
parent_link: bool = ...,
|
||||
to_field: Optional[str] = ...,
|
||||
db_constraint: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Warning]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str],
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||
]: ...
|
||||
def to_python(self, value: Union[int, str]) -> int: ...
|
||||
@property
|
||||
def target_field(self) -> Field: ...
|
||||
def get_reverse_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def validate(
|
||||
self, value: Union[int, str], model_instance: Model
|
||||
) -> None: ...
|
||||
def get_attname(self) -> str: ...
|
||||
def get_attname_column(self) -> Tuple[str, str]: ...
|
||||
def get_default(self) -> Optional[int]: ...
|
||||
def get_db_prep_save(
|
||||
self,
|
||||
value: Optional[Union[int, str, UUID]],
|
||||
connection: DatabaseWrapper,
|
||||
) -> Optional[Union[int, str]]: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Union[int, str, UUID],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Union[int, str]: ...
|
||||
def contribute_to_related_class(
|
||||
self, cls: Type[Model], related: ManyToOneRel
|
||||
) -> None: ...
|
||||
def formfield(
|
||||
self, *, using: Optional[Any] = ..., **kwargs: Any
|
||||
) -> ModelChoiceField: ...
|
||||
def db_check(self, connection: DatabaseWrapper) -> List[Any]: ...
|
||||
def db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
def db_parameters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> Dict[str, Union[List[Any], str]]: ...
|
||||
def convert_empty_strings(
|
||||
self, value: Any, expression: Any, connection: Any
|
||||
): ...
|
||||
def get_db_converters(self, connection: DatabaseWrapper) -> List[Any]: ...
|
||||
def get_col(
|
||||
self,
|
||||
alias: str,
|
||||
output_field: Optional[Union[Field, OneToOneRel]] = ...,
|
||||
) -> Col: ...
|
||||
|
||||
class OneToOneField(ForeignKey):
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
related_accessor_class: Any = ...
|
||||
forward_related_accessor_class: Any = ...
|
||||
rel_class: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
to: Union[Type[Model], str],
|
||||
on_delete: Callable,
|
||||
to_field: Optional[str] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str], str, List[Any], Dict[str, Union[Callable, bool, str]]
|
||||
]: ...
|
||||
def formfield(self, **kwargs: Any) -> None: ...
|
||||
def save_form_data(
|
||||
self, instance: Model, data: Optional[Model]
|
||||
) -> None: ...
|
||||
|
||||
def create_many_to_many_intermediary_model(field: Any, klass: Any): ...
|
||||
|
||||
class ManyToManyField(RelatedField):
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
rel_class: Any = ...
|
||||
description: Any = ...
|
||||
has_null_arg: Any = ...
|
||||
db_table: Any = ...
|
||||
swappable: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
to: Union[Type[Model], str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[Callable] = ...,
|
||||
symmetrical: Optional[bool] = ...,
|
||||
through: Optional[str] = ...,
|
||||
through_fields: Optional[Tuple[str, str]] = ...,
|
||||
db_constraint: bool = ...,
|
||||
db_table: None = ...,
|
||||
swappable: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, str]]: ...
|
||||
def get_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def get_reverse_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
) -> List[PathInfo]: ...
|
||||
m2m_db_table: Any = ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> None: ...
|
||||
m2m_column_name: Any = ...
|
||||
m2m_reverse_name: Any = ...
|
||||
m2m_field_name: Any = ...
|
||||
m2m_reverse_field_name: Any = ...
|
||||
m2m_target_field_name: Any = ...
|
||||
m2m_reverse_target_field_name: Any = ...
|
||||
def contribute_to_related_class(
|
||||
self, cls: Type[Model], related: ManyToManyRel
|
||||
) -> None: ...
|
||||
def set_attributes_from_rel(self) -> None: ...
|
||||
def value_from_object(self, obj: Model) -> List[Model]: ...
|
||||
def save_form_data(self, instance: Model, data: QuerySet) -> None: ...
|
||||
def formfield(
|
||||
self, *, using: Optional[Any] = ..., **kwargs: Any
|
||||
) -> ModelMultipleChoiceField: ...
|
||||
def db_check(self, connection: Any): ...
|
||||
def db_type(self, connection: Any): ...
|
||||
def db_parameters(self, connection: DatabaseWrapper) -> Dict[str, None]: ...
|
||||
110
django-stubs-generated/db/models/fields/related_descriptors.pyi
Normal file
110
django-stubs-generated/db/models/fields/related_descriptors.pyi
Normal file
@@ -0,0 +1,110 @@
|
||||
from typing import Any, Callable, List, Optional, Tuple, Type, Union, Generic, TypeVar
|
||||
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import F
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.related import ForeignObject, RelatedField, OneToOneField
|
||||
from django.db.models.fields.reverse_related import ManyToManyRel, OneToOneRel
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
|
||||
class ForwardManyToOneDescriptor:
|
||||
RelatedObjectDoesNotExist: Type[ObjectDoesNotExist]
|
||||
field: ForeignObject = ...
|
||||
|
||||
def __init__(self, field_with_rel: ForeignObject) -> None: ...
|
||||
|
||||
def is_cached(self, instance: Model) -> bool: ...
|
||||
|
||||
def get_queryset(self, **hints: Any) -> QuerySet: ...
|
||||
|
||||
def get_prefetch_queryset(
|
||||
self, instances: List[Model], queryset: Optional[QuerySet] = ...
|
||||
) -> Tuple[QuerySet, Callable, Callable, bool, str, bool]: ...
|
||||
|
||||
def get_object(self, instance: Model) -> Model: ...
|
||||
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Optional[Union[Model, ForwardManyToOneDescriptor]]: ...
|
||||
|
||||
def __set__(
|
||||
self, instance: Model, value: Optional[Union[Model, F]]
|
||||
) -> None: ...
|
||||
|
||||
def __reduce__(self) -> Tuple[Callable, Tuple[Type[Model], str]]: ...
|
||||
|
||||
|
||||
class ForwardOneToOneDescriptor(ForwardManyToOneDescriptor):
|
||||
RelatedObjectDoesNotExist: Type[ObjectDoesNotExist]
|
||||
field: OneToOneField
|
||||
|
||||
def get_object(self, instance: Model) -> Model: ...
|
||||
|
||||
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
|
||||
|
||||
|
||||
class ReverseOneToOneDescriptor:
|
||||
RelatedObjectDoesNotExist: Type[ObjectDoesNotExist]
|
||||
related: OneToOneRel = ...
|
||||
|
||||
def __init__(self, related: OneToOneRel) -> None: ...
|
||||
|
||||
def is_cached(self, instance: Model) -> bool: ...
|
||||
|
||||
def get_queryset(self, **hints: Any) -> QuerySet: ...
|
||||
|
||||
def get_prefetch_queryset(
|
||||
self, instances: List[Model], queryset: Optional[QuerySet] = ...
|
||||
) -> Tuple[QuerySet, Callable, Callable, bool, str, bool]: ...
|
||||
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Union[Model, ReverseOneToOneDescriptor]: ...
|
||||
|
||||
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
|
||||
|
||||
def __reduce__(self) -> Tuple[Callable, Tuple[Type[Model], str]]: ...
|
||||
|
||||
|
||||
class ReverseManyToOneDescriptor:
|
||||
rel: FieldCacheMixin = ...
|
||||
field: FieldCacheMixin = ...
|
||||
|
||||
def __init__(self, rel: FieldCacheMixin) -> None: ...
|
||||
|
||||
def related_manager_cls(self): ...
|
||||
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> ReverseManyToOneDescriptor: ...
|
||||
|
||||
def __set__(self, instance: Model, value: List[Model]) -> Any: ...
|
||||
|
||||
|
||||
def create_reverse_many_to_one_manager(superclass: Any, rel: Any): ...
|
||||
|
||||
|
||||
class ManyToManyDescriptor(ReverseManyToOneDescriptor):
|
||||
field: RelatedField
|
||||
rel: ManyToManyRel
|
||||
reverse: bool = ...
|
||||
|
||||
def __init__(self, rel: ManyToManyRel, reverse: bool = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def through(self) -> Type[Model]: ...
|
||||
|
||||
def related_manager_cls(self): ...
|
||||
|
||||
|
||||
class _ForwardManyToManyManager(Generic[_T]):
|
||||
def all(self) -> QuerySet: ...
|
||||
|
||||
|
||||
def create_forward_many_to_many_manager(
|
||||
superclass: Any, rel: Any, reverse: Any
|
||||
) -> _ForwardManyToManyManager: ...
|
||||
74
django-stubs-generated/db/models/fields/related_lookups.pyi
Normal file
74
django-stubs-generated/db/models/fields/related_lookups.pyi
Normal file
@@ -0,0 +1,74 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, List, Optional, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Col
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.fields.related import ForeignObject
|
||||
from django.db.models.lookups import (BuiltinLookup, Exact, GreaterThan,
|
||||
GreaterThanOrEqual, In, IsNull, LessThan,
|
||||
LessThanOrEqual)
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
|
||||
|
||||
class MultiColSource:
|
||||
alias: str
|
||||
field: django.db.models.fields.related.ForeignObject
|
||||
sources: Tuple[django.db.models.fields.Field, django.db.models.fields.Field]
|
||||
targets: Tuple[django.db.models.fields.Field, django.db.models.fields.Field]
|
||||
contains_aggregate: bool = ...
|
||||
output_field: django.db.models.fields.related.ForeignObject = ...
|
||||
def __init__(
|
||||
self,
|
||||
alias: str,
|
||||
targets: Tuple[Field, Field],
|
||||
sources: Tuple[Field, Field],
|
||||
field: related.ForeignObject,
|
||||
) -> None: ...
|
||||
def relabeled_clone(self, relabels: OrderedDict) -> MultiColSource: ...
|
||||
def get_lookup(self, lookup: str) -> Type[BuiltinLookup]: ...
|
||||
|
||||
def get_normalized_value(
|
||||
value: Any, lhs: Union[Col, MultiColSource]
|
||||
) -> Tuple[None]: ...
|
||||
|
||||
class RelatedIn(In):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: Union[
|
||||
django.db.models.expressions.Col,
|
||||
django.db.models.fields.related_lookups.MultiColSource,
|
||||
]
|
||||
rhs: Union[
|
||||
List[django.db.models.base.Model],
|
||||
List[int],
|
||||
List[uuid.UUID],
|
||||
Set[django.contrib.contenttypes.models.ContentType],
|
||||
Set[int],
|
||||
Set[str],
|
||||
Set[uuid.UUID],
|
||||
django.db.models.sql.query.Query,
|
||||
] = ...
|
||||
def get_prep_lookup(
|
||||
self
|
||||
) -> Union[List[Model], List[int], List[str], List[UUID], Query]: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class RelatedLookupMixin:
|
||||
rhs: Any = ...
|
||||
def get_prep_lookup(self) -> Any: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
|
||||
class RelatedExact(RelatedLookupMixin, Exact): ...
|
||||
class RelatedLessThan(RelatedLookupMixin, LessThan): ...
|
||||
class RelatedGreaterThan(RelatedLookupMixin, GreaterThan): ...
|
||||
class RelatedGreaterThanOrEqual(RelatedLookupMixin, GreaterThanOrEqual): ...
|
||||
class RelatedLessThanOrEqual(RelatedLookupMixin, LessThanOrEqual): ...
|
||||
class RelatedIsNull(RelatedLookupMixin, IsNull): ...
|
||||
180
django-stubs-generated/db/models/fields/reverse_related.pyi
Normal file
180
django-stubs-generated/db/models/fields/reverse_related.pyi
Normal file
@@ -0,0 +1,180 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import AutoField, Field
|
||||
from django.db.models.fields.related import (ForeignKey, OneToOneField,
|
||||
RelatedField)
|
||||
from django.db.models.lookups import BuiltinLookup, StartsWith
|
||||
from django.db.models.query_utils import FilteredRelation, PathInfo, Q
|
||||
from django.db.models.sql.where import WhereNode
|
||||
|
||||
from .mixins import FieldCacheMixin
|
||||
|
||||
|
||||
class ForeignObjectRel(FieldCacheMixin):
|
||||
hidden: bool
|
||||
many_to_many: bool
|
||||
many_to_one: bool
|
||||
name: str
|
||||
one_to_many: bool
|
||||
one_to_one: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
auto_created: bool = ...
|
||||
concrete: bool = ...
|
||||
editable: bool = ...
|
||||
is_relation: bool = ...
|
||||
null: bool = ...
|
||||
field: django.db.models.fields.related.ForeignObject = ...
|
||||
model: Union[Type[django.db.models.base.Model], str] = ...
|
||||
related_name: Optional[str] = ...
|
||||
related_query_name: None = ...
|
||||
limit_choices_to: Dict[Any, Any] = ...
|
||||
parent_link: bool = ...
|
||||
on_delete: Callable = ...
|
||||
symmetrical: bool = ...
|
||||
multiple: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: RelatedField,
|
||||
to: Union[Type[Model], str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[
|
||||
Union[Callable, Dict[str, Union[int, str]], Q]
|
||||
] = ...,
|
||||
parent_link: bool = ...,
|
||||
on_delete: Optional[Callable] = ...,
|
||||
) -> None: ...
|
||||
def hidden(self) -> bool: ...
|
||||
def name(self) -> str: ...
|
||||
@property
|
||||
def remote_field(self) -> RelatedField: ...
|
||||
@property
|
||||
def target_field(self) -> AutoField: ...
|
||||
def related_model(self) -> Type[Model]: ...
|
||||
def many_to_many(self) -> bool: ...
|
||||
def many_to_one(self) -> bool: ...
|
||||
def one_to_many(self) -> bool: ...
|
||||
def one_to_one(self) -> bool: ...
|
||||
def get_lookup(self, lookup_name: str) -> Type[BuiltinLookup]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
@property
|
||||
def db_type(self) -> Callable: ...
|
||||
def get_choices(
|
||||
self,
|
||||
include_blank: bool = ...,
|
||||
blank_choice: List[Tuple[str, str]] = ...,
|
||||
) -> List[Tuple[int, str]]: ...
|
||||
def is_hidden(self) -> bool: ...
|
||||
def get_joining_columns(self) -> Tuple: ...
|
||||
def get_extra_restriction(
|
||||
self, where_class: Type[WhereNode], alias: str, related_alias: str
|
||||
) -> Optional[Union[StartsWith, WhereNode]]: ...
|
||||
field_name: None = ...
|
||||
def set_field_name(self) -> None: ...
|
||||
def get_accessor_name(
|
||||
self, model: Optional[Type[Model]] = ...
|
||||
) -> Optional[str]: ...
|
||||
def get_path_info(
|
||||
self, filtered_relation: Optional[FilteredRelation] = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def get_cache_name(self) -> str: ...
|
||||
|
||||
class ManyToOneRel(ForeignObjectRel):
|
||||
field: django.db.models.fields.related.ForeignKey
|
||||
hidden: bool
|
||||
limit_choices_to: Union[
|
||||
Callable, Dict[str, Union[int, str]], django.db.models.query_utils.Q
|
||||
]
|
||||
many_to_many: bool
|
||||
many_to_one: bool
|
||||
model: Union[Type[django.db.models.base.Model], str]
|
||||
multiple: bool
|
||||
name: str
|
||||
on_delete: Callable
|
||||
one_to_many: bool
|
||||
one_to_one: bool
|
||||
parent_link: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: Optional[str]
|
||||
symmetrical: bool
|
||||
field_name: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: ForeignKey,
|
||||
to: Union[Type[Model], str],
|
||||
field_name: Optional[str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[
|
||||
Union[Callable, Dict[str, Union[int, str]], Q]
|
||||
] = ...,
|
||||
parent_link: bool = ...,
|
||||
on_delete: Callable = ...,
|
||||
) -> None: ...
|
||||
def get_related_field(self) -> Field: ...
|
||||
def set_field_name(self) -> None: ...
|
||||
|
||||
class OneToOneRel(ManyToOneRel):
|
||||
field: django.db.models.fields.related.OneToOneField
|
||||
field_name: Optional[str]
|
||||
hidden: bool
|
||||
limit_choices_to: Dict[str, str]
|
||||
many_to_many: bool
|
||||
many_to_one: bool
|
||||
model: Union[Type[django.db.models.base.Model], str]
|
||||
name: str
|
||||
on_delete: Callable
|
||||
one_to_many: bool
|
||||
one_to_one: bool
|
||||
parent_link: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: Optional[str]
|
||||
symmetrical: bool
|
||||
multiple: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: OneToOneField,
|
||||
to: Union[Type[Model], str],
|
||||
field_name: Optional[str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[Dict[str, str]] = ...,
|
||||
parent_link: bool = ...,
|
||||
on_delete: Callable = ...,
|
||||
) -> None: ...
|
||||
|
||||
class ManyToManyRel(ForeignObjectRel):
|
||||
field: django.db.models.fields.related.RelatedField
|
||||
field_name: None
|
||||
hidden: bool
|
||||
limit_choices_to: Union[Callable, Dict[str, str]]
|
||||
model: Union[Type[django.db.models.base.Model], str]
|
||||
multiple: bool
|
||||
name: str
|
||||
on_delete: None
|
||||
one_to_many: bool
|
||||
one_to_one: bool
|
||||
parent_link: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: Optional[str]
|
||||
through: Optional[Union[Type[django.db.models.base.Model], str]] = ...
|
||||
through_fields: Optional[Tuple[str, str]] = ...
|
||||
symmetrical: bool = ...
|
||||
db_constraint: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: RelatedField,
|
||||
to: Union[Type[Model], str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[Union[Callable, Dict[str, str]]] = ...,
|
||||
symmetrical: bool = ...,
|
||||
through: Optional[Union[Type[Model], str]] = ...,
|
||||
through_fields: Optional[Tuple[str, str]] = ...,
|
||||
db_constraint: bool = ...,
|
||||
) -> None: ...
|
||||
def get_related_field(self) -> Field: ...
|
||||
Reference in New Issue
Block a user