better stubs

This commit is contained in:
Maxim Kurnikov
2018-08-05 03:13:19 +03:00
parent 4013fe4d03
commit fa718b8e55
380 changed files with 11805 additions and 8503 deletions

View File

@@ -1,77 +1,75 @@
# Stubs for django.db.models.deletion (Python 3.6)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
Union)
from django.contrib.admin.utils import NestedObjects
from django.db import IntegrityError
from typing import Any, Optional
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import ContentType
from django.db.models.base import Model
from django.db.models.fields.related import ForeignKey
from django.db.models.fields.reverse_related import ManyToOneRel
from django.db.models.options import Options
from django.db.models.query import QuerySet
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union
class ProtectedError(IntegrityError):
protected_objects: Any = ...
protected_objects: django.db.models.query.QuerySet = ...
def __init__(
self, msg: str, protected_objects: Union[List[Model], QuerySet]
self, msg: str, protected_objects: Union[QuerySet, List[Model]]
) -> None: ...
def CASCADE(
collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str
) -> None: ...
def PROTECT(collector: Any, field: Any, sub_objs: Any, using: Any) -> None: ...
def SET(value: int) -> Callable: ...
def SET_NULL(
collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str
) -> None: ...
def PROTECT(
collector: NestedObjects, field: ForeignKey, sub_objs: QuerySet, using: str
) -> Any: ...
def SET(value: Callable) -> Callable: ...
def SET_NULL(collector: Any, field: Any, sub_objs: Any, using: Any) -> None: ...
def SET_DEFAULT(
collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str
collector: Any, field: Any, sub_objs: Any, using: Any
) -> None: ...
def DO_NOTHING(
collector: Any, field: Any, sub_objs: Any, using: Any
) -> None: ...
def DO_NOTHING(collector: Any, field: Any, sub_objs: Any, using: Any) -> None: ...
def get_candidate_relations_to_delete(opts: Options) -> Iterator[Any]: ...
class Collector:
using: Any = ...
data: Any = ...
field_updates: Any = ...
fast_deletes: Any = ...
dependencies: Any = ...
using: str = ...
data: collections.OrderedDict = ...
field_updates: Dict[Any, Any] = ...
fast_deletes: List[Any] = ...
dependencies: Dict[Any, Any] = ...
def __init__(self, using: str) -> None: ...
def add(
self,
objs: Any,
source: Optional[Union[Type[Model], Type[ContentType]]] = ...,
objs: Union[List[Model], QuerySet],
source: Optional[Type[Model]] = ...,
nullable: bool = ...,
reverse_dependency: bool = ...,
) -> Any: ...
) -> List[Model]: ...
def add_field_update(
self, field: ForeignKey, value: Optional[int], objs: QuerySet
self, field: ForeignKey, value: None, objs: QuerySet
) -> None: ...
def can_fast_delete(
self, objs: Any, from_field: Optional[ForeignKey] = ...
self,
objs: Union[List[Model], QuerySet],
from_field: Optional[ForeignKey] = ...,
) -> bool: ...
def get_del_batches(
self,
objs: Union[List[User], List[Model], List[ContentType], List[Permission]],
field: ForeignKey,
) -> Union[
List[List[Model]], List[List[ContentType]], List[List[User]], List[List[Permission]]
]: ...
self, objs: List[Model], field: ForeignKey
) -> List[List[Model]]: ...
def collect(
self,
objs: Any,
source: Optional[Union[Type[Model], Type[ContentType]]] = ...,
objs: Union[List[Model], QuerySet],
source: Optional[Type[Model]] = ...,
nullable: bool = ...,
collect_related: bool = ...,
source_attr: Optional[str] = ...,
reverse_dependency: bool = ...,
keep_parents: bool = ...,
) -> None: ...
def related_objects(self, related: ManyToOneRel, objs: Any) -> QuerySet: ...
def instances_with_model(self) -> Iterator[Any]: ...
def related_objects(
self, related: ManyToOneRel, objs: List[Model]
) -> QuerySet: ...
def instances_with_model(self) -> Iterator[Tuple[Type[Model], Model]]: ...
def sort(self) -> None: ...
def delete(self) -> Union[Tuple[int, Dict[str, int]], Tuple[int, Dict[Any, Any]]]: ...
def delete(self) -> Tuple[int, Dict[str, int]]: ...