initial commit

This commit is contained in:
Maxim Kurnikov
2018-07-29 18:12:23 +03:00
commit a9f215bf64
311 changed files with 13433 additions and 0 deletions

View File

@@ -0,0 +1,117 @@
from datetime import date
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 OuterRef
from django.db.models.sql.compiler import SQLCompiler
from django.forms.fields import (
BaseTemporalField,
BooleanField,
CharField,
IntegerField,
SplitDateTimeField,
TypedChoiceField,
)
from typing import (
Any,
List,
Optional,
Union,
)
class AutoField:
def __init__(self, *args, **kwargs) -> None: ...
def _check_primary_key(self) -> List[Any]: ...
def check(self, **kwargs) -> List[Any]: ...
def contribute_to_class(self, cls: Any, name: str, **kwargs) -> None: ...
def deconstruct(self) -> Any: ...
def formfield(self, **kwargs) -> None: ...
def get_db_prep_value(
self,
value: Union[str, int],
connection: DatabaseWrapper,
prepared: bool = ...
) -> Union[str, int]: ...
def get_internal_type(self) -> str: ...
def get_prep_value(self, value: Any) -> Optional[Union[int, OuterRef]]: ...
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
def to_python(self, value: Optional[Union[str, int]]) -> Optional[int]: ...
def validate(self, value: int, model_instance: Model) -> None: ...
class BigAutoField:
def get_internal_type(self) -> str: ...
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
class BigIntegerField:
def formfield(self, **kwargs) -> IntegerField: ...
def get_internal_type(self) -> str: ...
class BinaryField:
def __init__(self, *args, **kwargs) -> None: ...
def deconstruct(self) -> Any: ...
def get_db_prep_value(
self,
value: Optional[Union[bytes, memoryview]],
connection: DatabaseWrapper,
prepared: bool = ...
) -> Optional[memoryview]: ...
def get_default(self) -> Optional[bytes]: ...
def get_internal_type(self) -> str: ...
def get_placeholder(
self,
value: Optional[memoryview],
compiler: SQLCompiler,
connection: DatabaseWrapper
) -> str: ...
def to_python(self, value: Optional[Union[str, bytes]]) -> Optional[Union[bytes, memoryview]]: ...
class BooleanField:
def formfield(self, **kwargs) -> BooleanField: ...
def get_internal_type(self) -> str: ...
def get_prep_value(self, value: Optional[Union[str, int]]) -> Optional[bool]: ...
def to_python(self, value: Optional[Union[str, int]]) -> bool: ...
class CharField:
def __init__(self, *args, **kwargs) -> None: ...
def _check_max_length_attribute(self, **kwargs) -> List[Error]: ...
def check(self, **kwargs) -> List[Error]: ...
def formfield(self, **kwargs) -> Union[CharField, TypedChoiceField]: ...
def get_internal_type(self) -> str: ...
def get_prep_value(self, value: Any) -> object: ...
def to_python(self, value: Optional[Union[int, str, Model]]) -> Optional[str]: ...
class DateField:
def __init__(
self,
verbose_name: Optional[str] = ...,
name: Optional[str] = ...,
auto_now: bool = ...,
auto_now_add: bool = ...,
**kwargs
) -> None: ...
def _check_fix_default_value(self) -> List[Warning]: ...
def contribute_to_class(self, cls: Any, name: str, **kwargs) -> None: ...
def deconstruct(self) -> Any: ...
def formfield(
self,
**kwargs
) -> Union[SplitDateTimeField, BaseTemporalField]: ...
def get_db_prep_value(
self,
value: Optional[Union[date, str]],
connection: DatabaseWrapper,
prepared: bool = ...
) -> Optional[str]: ...
def get_internal_type(self) -> str: ...
def get_prep_value(self, value: Optional[Union[str, date]]) -> Optional[date]: ...
def pre_save(self, model_instance: Model, add: bool) -> Optional[date]: ...

View File

@@ -0,0 +1,92 @@
from django.core.checks.messages import Error
from django.core.files.base import (
ContentFile,
File,
)
from django.core.files.storage import Storage
from django.core.files.uploadedfile import (
InMemoryUploadedFile,
SimpleUploadedFile,
UploadedFile,
)
from django.db.models.base import Model
from django.forms.fields import FileField
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Tuple,
Union,
)
class FieldFile:
def __eq__(self, other: Optional[Union[Tuple, str, FieldFile]]) -> bool: ...
def __getstate__(self) -> Dict[str, Union[str, bool, None]]: ...
def __init__(
self,
instance: Model,
field: FileField,
name: Optional[str]
) -> None: ...
def _del_file(self) -> None: ...
def _get_file(self) -> File: ...
def _require_file(self) -> None: ...
def _set_file(self, file: Optional[File]) -> None: ...
def close(self) -> None: ...
def delete(self, save: bool = ...) -> None: ...
def open(self, mode: str = ...) -> FieldFile: ...
def save(
self,
name: str,
content: Union[ContentFile, UploadedFile],
save: bool = ...
) -> None: ...
@property
def url(self) -> str: ...
class FileDescriptor:
def __get__(
self,
instance: Any,
cls: Any = ...
) -> Union[FileDescriptor, FieldFile]: ...
def __init__(self, field: FileField) -> None: ...
def __set__(
self,
instance: Model,
value: Optional[Union[str, FieldFile, InMemoryUploadedFile]]
) -> None: ...
class FileField:
def __init__(
self,
verbose_name: Optional[str] = ...,
name: None = ...,
upload_to: Union[str, Callable] = ...,
storage: Optional[Storage] = ...,
**kwargs
) -> None: ...
def _check_primary_key(self) -> List[Error]: ...
def _check_upload_to(self) -> List[Any]: ...
def check(self, **kwargs) -> List[Any]: ...
def contribute_to_class(self, cls: Any, name: str, **kwargs) -> None: ...
def deconstruct(self) -> Any: ...
def formfield(self, **kwargs) -> FileField: ...
def generate_filename(self, instance: Any, filename: str) -> str: ...
def get_internal_type(self) -> str: ...
def get_prep_value(self, value: FieldFile) -> str: ...
def pre_save(
self,
model_instance: Model,
add: bool
) -> FieldFile: ...
def save_form_data(
self,
instance: Model,
data: Optional[Union[bool, FieldFile, SimpleUploadedFile]]
) -> None: ...

View File

@@ -0,0 +1,9 @@
from django.db.models.base import Model
from typing import Any
class FieldCacheMixin:
def delete_cached_value(self, instance: Model) -> None: ...
def get_cached_value(self, instance: Model, default: object = ...) -> Any: ...
def is_cached(self, instance: Model) -> bool: ...
def set_cached_value(self, instance: Model, value: Any) -> None: ...

View File

@@ -0,0 +1,2 @@
class OrderWrt:
def __init__(self, *args, **kwargs) -> None: ...

View File

@@ -0,0 +1,101 @@
from django.core.checks.messages import (
Error,
Warning,
)
from django.db.backends.sqlite3.base import DatabaseWrapper
from django.db.models.expressions import Col
from django.db.models.fields import Field
from django.db.models.fields.reverse_related import (
ForeignObjectRel,
ManyToOneRel,
)
from django.db.models.query_utils import (
FilteredRelation,
PathInfo,
)
from django.forms.models import ModelChoiceField
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Tuple,
Union,
)
from uuid import UUID
class ForeignKey:
def __init__(
self,
to: Any,
on_delete: Callable,
related_name: Optional[str] = ...,
related_query_name: Optional[str] = ...,
limit_choices_to: Any = ...,
parent_link: bool = ...,
to_field: Optional[str] = ...,
db_constraint: bool = ...,
**kwargs
) -> None: ...
def _check_on_delete(self) -> List[Any]: ...
def _check_unique(self, **kwargs) -> List[Warning]: ...
def check(
self,
**kwargs
) -> Union[List[Error], List[Warning]]: ...
def contribute_to_related_class(
self,
cls: Any,
related: ManyToOneRel
) -> None: ...
def db_check(self, connection: DatabaseWrapper) -> List[Any]: ...
def db_parameters(self, connection: DatabaseWrapper) -> Dict[str, str]: ...
def db_type(self, connection: DatabaseWrapper) -> str: ...
def deconstruct(self) -> Any: ...
def formfield(self, *, using = ..., **kwargs) -> ModelChoiceField: ...
def get_attname(self) -> str: ...
def get_attname_column(self) -> Tuple[str, str]: ...
def get_col(self, alias: str, output_field: Any = ...) -> Col: ...
def get_db_converters(self, connection: DatabaseWrapper) -> List[Any]: ...
def get_db_prep_save(
self,
value: Any,
connection: DatabaseWrapper
) -> Optional[Union[str, int]]: ...
def get_db_prep_value(
self,
value: Union[str, UUID, int],
connection: DatabaseWrapper,
prepared: bool = ...
) -> Union[str, int]: ...
def get_default(self) -> Optional[int]: ...
def get_reverse_path_info(
self,
filtered_relation: Optional[FilteredRelation] = ...
) -> List[PathInfo]: ...
@property
def target_field(self) -> Field: ...
def to_python(self, value: Union[str, int]) -> Union[str, int]: ...
def validate(self, value: int, model_instance: Any) -> None: ...
class ForeignObject:
def __init__(
self,
to: Any,
on_delete: Callable,
from_fields: Union[Tuple[str, str], List[str]],
to_fields: Union[List[str], List[None], Tuple[str, str]],
rel: Optional[ForeignObjectRel] = ...,
related_name: Optional[str] = ...,
related_query_name: None = ...,
limit_choices_to: None = ...,
parent_link: bool = ...,
swappable: bool = ...,
**kwargs
) -> None: ...
def _check_to_fields_exist(self) -> List[Error]: ...
def _check_unique_target(self) -> List[Error]: ...
def check(self, **kwargs) -> List[Error]: ...

View File

@@ -0,0 +1,61 @@
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.base import Model
from django.db.models.fields.related import ForeignObject
from django.db.models.fields.reverse_related import (
ForeignObjectRel,
ManyToManyRel,
OneToOneRel,
)
from django.db.models.query import QuerySet
from typing import (
Any,
Callable,
Optional,
Tuple,
Type,
)
class ForwardManyToOneDescriptor:
@cached_property
def RelatedObjectDoesNotExist(self) -> Type[ObjectDoesNotExist]: ...
def __get__(self, instance: Any, cls: Any = ...) -> Any: ...
def __init__(self, field_with_rel: ForeignObject) -> None: ...
def __set__(self, instance: Model, value: Any) -> None: ...
def get_object(self, instance: Model) -> Model: ...
def get_prefetch_queryset(
self,
instances: Any,
queryset: Optional[QuerySet] = ...
) -> Tuple[QuerySet, Callable, Callable, bool, str, bool]: ...
def get_queryset(self, **hints) -> QuerySet: ...
def is_cached(self, instance: Model) -> bool: ...
class ForwardOneToOneDescriptor:
def __set__(self, instance: Model, value: Any) -> None: ...
def get_object(self, instance: Model) -> Model: ...
class ManyToManyDescriptor:
def __init__(self, rel: ManyToManyRel, reverse: bool = ...) -> None: ...
class ReverseManyToOneDescriptor:
def __get__(
self,
instance: Optional[Model],
cls: Any = ...
) -> ReverseManyToOneDescriptor: ...
def __init__(self, rel: ForeignObjectRel) -> None: ...
def _get_set_deprecation_msg_params(self) -> Tuple[str, str]: ...
class ReverseOneToOneDescriptor:
@cached_property
def RelatedObjectDoesNotExist(self) -> Type[ObjectDoesNotExist]: ...
def __get__(self, instance: Any, cls: Any = ...) -> Any: ...
def __init__(self, related: OneToOneRel) -> None: ...
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
def get_queryset(self, **hints) -> QuerySet: ...
def is_cached(self, instance: Model) -> bool: ...

View File

@@ -0,0 +1,63 @@
from collections import OrderedDict
from django.db.backends.sqlite3.base import DatabaseWrapper
from django.db.models.expressions import Col
from django.db.models.fields import (
AutoField,
IntegerField,
)
from django.db.models.fields.related import (
ForeignKey,
ForeignObject,
)
from django.db.models.sql.compiler import SQLCompiler
from django.db.models.sql.query import Query
from typing import (
Any,
List,
Tuple,
Type,
Union,
)
from uuid import UUID
def get_normalized_value(
value: Any,
lhs: Union[MultiColSource, Col]
) -> Any: ...
class MultiColSource:
def __init__(
self,
alias: str,
targets: Union[Tuple[IntegerField, related.ForeignKey], Tuple[IntegerField, IntegerField]],
sources: Union[Tuple[AutoField, IntegerField], Tuple[IntegerField, AutoField]],
field: related.ForeignObject
) -> None: ...
def get_lookup(
self,
lookup: str
) -> Type[Union[RelatedIn, RelatedExact]]: ...
def relabeled_clone(
self,
relabels: OrderedDict
) -> MultiColSource: ...
class RelatedIn:
def as_sql(
self,
compiler: SQLCompiler,
connection: DatabaseWrapper
) -> Union[Tuple[str, List[int]], Tuple[str, List[Any]], Tuple[str, List[str]]]: ...
def get_prep_lookup(self) -> Union[List[UUID], Query, List[int], List[str]]: ...
class RelatedLookupMixin:
def as_sql(
self,
compiler: SQLCompiler,
connection: DatabaseWrapper
) -> Union[Tuple[str, List[int]], Tuple[str, List[Any]], Tuple[str, List[str]]]: ...
def get_prep_lookup(self) -> Any: ...

View File

@@ -0,0 +1,122 @@
from django.db.models.base import Model
from django.db.models.fields import (
AutoField,
Field,
)
from django.db.models.fields.related import (
ForeignKey,
ManyToManyField,
RelatedField,
)
from django.db.models.fields.related_lookups import (
RelatedExact,
RelatedIn,
RelatedIsNull,
)
from django.db.models.query_utils import (
FilteredRelation,
PathInfo,
)
from django.db.models.sql.where import WhereNode
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Tuple,
Type,
Union,
)
class ForeignObjectRel:
def __init__(
self,
field: RelatedField,
to: Any,
related_name: Optional[str] = ...,
related_query_name: Optional[str] = ...,
limit_choices_to: Any = ...,
parent_link: bool = ...,
on_delete: Optional[Callable] = ...
) -> None: ...
def __repr__(self) -> str: ...
@property
def db_type(self) -> Callable: ...
def get_accessor_name(self, model: Any = ...) -> Optional[str]: ...
def get_cache_name(self) -> str: ...
def get_choices(
self,
include_blank: bool = ...,
blank_choice: List[Tuple[str, str]] = ...
) -> List[Tuple[int, str]]: ...
def get_extra_restriction(
self,
where_class: Type[WhereNode],
alias: str,
related_alias: str
) -> Optional[WhereNode]: ...
def get_internal_type(self) -> str: ...
def get_joining_columns(self) -> Union[Tuple[Tuple[str, str]], Tuple[Tuple[str, str], Tuple[str, str]]]: ...
def get_lookup(
self,
lookup_name: str
) -> Type[Union[RelatedIsNull, RelatedIn, RelatedExact]]: ...
def get_path_info(
self,
filtered_relation: Optional[FilteredRelation] = ...
) -> List[PathInfo]: ...
@cached_property
def hidden(self) -> bool: ...
def is_hidden(self) -> bool: ...
@cached_property
def many_to_many(self) -> bool: ...
@cached_property
def many_to_one(self) -> bool: ...
@cached_property
def name(self) -> str: ...
@cached_property
def one_to_many(self) -> bool: ...
@cached_property
def one_to_one(self) -> bool: ...
@cached_property
def related_model(self) -> Any: ...
@property
def remote_field(
self
) -> Union[ManyToManyField, ForeignKey]: ...
def set_field_name(self) -> None: ...
@property
def target_field(self) -> AutoField: ...
class ManyToManyRel:
def __init__(
self,
field: RelatedField,
to: Any,
related_name: Optional[str] = ...,
related_query_name: Optional[str] = ...,
limit_choices_to: Optional[Callable] = ...,
symmetrical: bool = ...,
through: Optional[Union[str, Type[Model]]] = ...,
through_fields: Optional[Tuple[str, str]] = ...,
db_constraint: bool = ...
) -> None: ...
def get_related_field(self) -> Field: ...
class ManyToOneRel:
def __getstate__(self) -> Dict[str, Any]: ...
def __init__(
self,
field: ForeignKey,
to: Any,
field_name: Optional[str],
related_name: Optional[str] = ...,
related_query_name: Optional[str] = ...,
limit_choices_to: Any = ...,
parent_link: bool = ...,
on_delete: Callable = ...
) -> None: ...