From 8ea59985dfc647812998df554b5a55d605f8d09c Mon Sep 17 00:00:00 2001 From: Sid Mitra Date: Fri, 3 Apr 2020 11:02:34 -0300 Subject: [PATCH] Add RESTRICT and RestrictedError to django.db.models.deletion (#345) * Add RESTRICT and RestrictedError to django.db.models.deletion * Add black fomatting changes --- django-stubs/db/models/__init__.pyi | 3 +++ django-stubs/db/models/deletion.pyi | 2 ++ 2 files changed, 5 insertions(+) diff --git a/django-stubs/db/models/__init__.pyi b/django-stubs/db/models/__init__.pyi index f9bd66e..1e10126 100644 --- a/django-stubs/db/models/__init__.pyi +++ b/django-stubs/db/models/__init__.pyi @@ -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 ( diff --git a/django-stubs/db/models/deletion.pyi b/django-stubs/db/models/deletion.pyi index 6bc0069..061e5b7 100644 --- a/django-stubs/db/models/deletion.pyi +++ b/django-stubs/db/models/deletion.pyi @@ -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: ...