third iteration of stubs

This commit is contained in:
Maxim Kurnikov
2018-08-11 00:19:50 +03:00
parent fa718b8e55
commit c6bceb19f4
216 changed files with 16306 additions and 3006 deletions

View File

@@ -2,11 +2,12 @@ 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, ManyToManyField,
OneToOneField, RelatedField)
from django.db.models.fields.related_lookups import RelatedExact, RelatedIn
from django.db.models.fields.related import (ForeignKey, OneToOneField,
RelatedField)
from django.db.models.fields.related_lookups import (RelatedExact, RelatedIn,
RelatedIsNull)
from django.db.models.lookups import StartsWith
from django.db.models.query_utils import PathInfo
from django.db.models.query_utils import FilteredRelation, PathInfo, Q
from django.db.models.sql.where import WhereNode
from .mixins import FieldCacheMixin
@@ -14,7 +15,11 @@ 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 = ...
@@ -22,8 +27,8 @@ class ForeignObjectRel(FieldCacheMixin):
is_relation: bool = ...
null: bool = ...
field: django.db.models.fields.related.ForeignObject = ...
model: Type[django.db.models.base.Model] = ...
related_name: str = ...
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 = ...
@@ -37,7 +42,7 @@ class ForeignObjectRel(FieldCacheMixin):
related_name: Optional[str] = ...,
related_query_name: Optional[str] = ...,
limit_choices_to: Optional[
Union[Callable, Dict[str, Union[str, int]]]
Union[Callable, Dict[str, Union[int, str]], Q]
] = ...,
parent_link: bool = ...,
on_delete: Optional[Callable] = ...,
@@ -45,7 +50,7 @@ class ForeignObjectRel(FieldCacheMixin):
def hidden(self) -> bool: ...
def name(self) -> str: ...
@property
def remote_field(self) -> OneToOneField: ...
def remote_field(self) -> RelatedField: ...
@property
def target_field(self) -> AutoField: ...
def related_model(self) -> Type[Model]: ...
@@ -55,31 +60,39 @@ class ForeignObjectRel(FieldCacheMixin):
def one_to_one(self) -> bool: ...
def get_lookup(
self, lookup_name: str
) -> Type[Union[RelatedExact, RelatedIn]]: ...
) -> Type[Union[RelatedExact, RelatedIn, RelatedIsNull]]: ...
def get_internal_type(self) -> str: ...
@property
def db_type(self) -> Callable: ...
def get_choices(
self, include_blank: bool = ..., blank_choice: Any = ...
): ...
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[StartsWith]: ...
) -> Optional[Union[StartsWith, WhereNode]]: ...
field_name: None = ...
def set_field_name(self) -> None: ...
def get_accessor_name(self, model: Optional[Type[Model]] = ...) -> str: ...
def get_accessor_name(
self, model: Optional[Type[Model]] = ...
) -> Optional[str]: ...
def get_path_info(
self, filtered_relation: None = ...
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: Dict[Any, Any]
model: Type[django.db.models.base.Model]
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
@@ -88,7 +101,7 @@ class ManyToOneRel(ForeignObjectRel):
parent_link: bool
related_model: Type[django.db.models.base.Model]
related_name: Optional[str]
related_query_name: None
related_query_name: Optional[str]
symmetrical: bool
field_name: Optional[str] = ...
def __init__(
@@ -97,9 +110,9 @@ class ManyToOneRel(ForeignObjectRel):
to: Union[Type[Model], str],
field_name: Optional[str],
related_name: Optional[str] = ...,
related_query_name: None = ...,
related_query_name: Optional[str] = ...,
limit_choices_to: Optional[
Union[Callable, Dict[str, Union[str, int]]]
Union[Callable, Dict[str, Union[int, str]], Q]
] = ...,
parent_link: bool = ...,
on_delete: Callable = ...,
@@ -109,16 +122,20 @@ class ManyToOneRel(ForeignObjectRel):
class OneToOneRel(ManyToOneRel):
field: django.db.models.fields.related.OneToOneField
field_name: str
field_name: Optional[str]
hidden: bool
limit_choices_to: Dict[Any, Any]
model: Type[django.db.models.base.Model]
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: None
related_query_name: Optional[str]
symmetrical: bool
multiple: bool = ...
def __init__(
@@ -126,41 +143,42 @@ class OneToOneRel(ManyToOneRel):
field: OneToOneField,
to: Union[Type[Model], str],
field_name: Optional[str],
related_name: None = ...,
related_query_name: None = ...,
limit_choices_to: None = ...,
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.ManyToManyField
field: django.db.models.fields.related.RelatedField
field_name: None
hidden: bool
limit_choices_to: Dict[Any, Any]
model: Union[
django.db.migrations.writer.SettingsReference,
Type[django.db.models.base.Model],
]
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: None
through: Optional[Type[django.db.models.base.Model]] = ...
through_fields: None = ...
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: ManyToManyField,
field: RelatedField,
to: Union[Type[Model], str],
related_name: Optional[str] = ...,
related_query_name: Optional[str] = ...,
limit_choices_to: Optional[Callable] = ...,
limit_choices_to: Optional[Union[Callable, Dict[str, str]]] = ...,
symmetrical: bool = ...,
through: Optional[str] = ...,
through_fields: None = ...,
through: Optional[Union[Type[Model], str]] = ...,
through_fields: Optional[Tuple[str, str]] = ...,
db_constraint: bool = ...,
) -> None: ...
def get_related_field(self) -> AutoField: ...
def get_related_field(self) -> Field: ...