Add get_candidate_relations_to_delete (#92)

* Set a precise type for Model._meta

* Add missing 'get_candidate_relations_to_delete' function signature

Fixes https://github.com/mkurnikov/django-stubs/issues/77.
This commit is contained in:
Peter Law
2019-07-01 16:50:01 +01:00
committed by Maxim Kurnikov
parent 2295b14214
commit 25165de80f
2 changed files with 7 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
from typing import Any, Callable
from typing import Any, Callable, Iterable
from django.db import IntegrityError
from django.db.models.fields import Field
from django.db.models.options import Options
def CASCADE(collector, field, sub_objs, using): ...
def SET_NULL(collector, field, sub_objs, using): ...
@@ -9,6 +11,8 @@ def DO_NOTHING(collector, field, sub_objs, using): ...
def PROTECT(collector, field, sub_objs, using): ...
def SET(value: Any) -> Callable: ...
def get_candidate_relations_to_delete(opts: Options) -> Iterable[Field]: ...
class ProtectedError(IntegrityError): ...
class Collector: