extend ProtectedError and RestrictedError stubs (#682)

types for their properties
This commit is contained in:
Tim Nyborg
2021-08-03 09:13:15 +01:00
committed by GitHub
parent 696f39b58c
commit 44f7c25a4e

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Collection, Iterable, Optional, Type, Union
from typing import Any, Callable, Collection, Iterable, Optional, Set, Type, Union
from django.db import IntegrityError
from django.db.models.base import Model
@@ -14,8 +14,13 @@ def RESTRICT(collector, field, sub_objs, using): ...
def SET(value: Any) -> Callable: ...
def get_candidate_relations_to_delete(opts: Options) -> Iterable[Field]: ...
class ProtectedError(IntegrityError): ...
class RestrictedError(IntegrityError): ...
class ProtectedError(IntegrityError):
protected_objects: Set[Model]
def __init__(self, msg: str, protected_objects: Set[Model]) -> None: ...
class RestrictedError(IntegrityError):
restricted_objects: Set[Model]
def __init__(self, msg: str, restricted_objects: Set[Model]) -> None: ...
class Collector:
def __init__(self, using: str) -> None: ...