mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-16 08:47:49 +08:00
run black over stubs, add checking to travis
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
||||
Union)
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.db import IntegrityError
|
||||
from django.db.models.base import Model
|
||||
@@ -8,29 +7,16 @@ from django.db.models.fields.reverse_related import ManyToOneRel
|
||||
from django.db.models.options import Options
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
|
||||
class ProtectedError(IntegrityError):
|
||||
protected_objects: django.db.models.query.QuerySet = ...
|
||||
def __init__(
|
||||
self, msg: str, protected_objects: Union[List[Model], QuerySet]
|
||||
) -> None: ...
|
||||
def __init__(self, msg: str, protected_objects: Union[List[Model], QuerySet]) -> None: ...
|
||||
|
||||
def CASCADE(
|
||||
collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str
|
||||
) -> None: ...
|
||||
def PROTECT(
|
||||
collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str
|
||||
) -> Any: ...
|
||||
def CASCADE(collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str) -> None: ...
|
||||
def PROTECT(collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str) -> Any: ...
|
||||
def SET(value: Callable) -> Callable: ...
|
||||
def SET_NULL(
|
||||
collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str
|
||||
) -> None: ...
|
||||
def SET_DEFAULT(
|
||||
collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str
|
||||
) -> None: ...
|
||||
def DO_NOTHING(
|
||||
collector: Any, field: Any, sub_objs: Any, using: Any
|
||||
) -> None: ...
|
||||
def SET_NULL(collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str) -> None: ...
|
||||
def SET_DEFAULT(collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str) -> 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:
|
||||
@@ -47,17 +33,9 @@ class Collector:
|
||||
nullable: bool = ...,
|
||||
reverse_dependency: bool = ...,
|
||||
) -> List[Model]: ...
|
||||
def add_field_update(
|
||||
self, field: ForeignKey, value: Optional[int], objs: QuerySet
|
||||
) -> None: ...
|
||||
def can_fast_delete(
|
||||
self,
|
||||
objs: Union[List[Model], QuerySet],
|
||||
from_field: Optional[ForeignKey] = ...,
|
||||
) -> bool: ...
|
||||
def get_del_batches(
|
||||
self, objs: List[Model], field: ForeignKey
|
||||
) -> List[List[Model]]: ...
|
||||
def add_field_update(self, field: ForeignKey, value: Optional[int], objs: QuerySet) -> None: ...
|
||||
def can_fast_delete(self, objs: Union[List[Model], QuerySet], from_field: Optional[ForeignKey] = ...) -> bool: ...
|
||||
def get_del_batches(self, objs: List[Model], field: ForeignKey) -> List[List[Model]]: ...
|
||||
def collect(
|
||||
self,
|
||||
objs: Union[List[Model], QuerySet],
|
||||
@@ -68,9 +46,7 @@ class Collector:
|
||||
reverse_dependency: bool = ...,
|
||||
keep_parents: bool = ...,
|
||||
) -> None: ...
|
||||
def related_objects(
|
||||
self, related: ManyToOneRel, objs: List[Model]
|
||||
) -> QuerySet: ...
|
||||
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) -> Tuple[int, Dict[str, int]]: ...
|
||||
|
||||
Reference in New Issue
Block a user