Add RESTRICT and RestrictedError to django.db.models.deletion (#345)

* Add RESTRICT and RestrictedError to django.db.models.deletion

* Add black fomatting changes
This commit is contained in:
Sid Mitra
2020-04-03 11:02:34 -03:00
committed by GitHub
parent 2964ed53d7
commit 8ea59985df
2 changed files with 5 additions and 0 deletions

View File

@@ -68,6 +68,9 @@ from .deletion import (
DO_NOTHING as DO_NOTHING,
PROTECT as PROTECT,
SET as SET,
RESTRICT as RESTRICT,
ProtectedError as ProtectedError,
RestrictedError as RestrictedError,
)
from .query import (

View File

@@ -11,10 +11,12 @@ def SET_NULL(collector, field, sub_objs, using): ...
def SET_DEFAULT(collector, field, sub_objs, using): ...
def DO_NOTHING(collector, field, sub_objs, using): ...
def PROTECT(collector, field, sub_objs, using): ...
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 Collector:
def __init__(self, using: str) -> None: ...