1
0
mirror of https://github.com/django/django.git synced 2025-06-07 04:29:12 +00:00

[2.1.x] Fixed #29398 -- Doc'd that cascade deletion doesn't call delete() of related models.

Backport of e038f98bf342af716cf16e38be989c2d0f126797 from master
This commit is contained in:
Tim Graham 2018-05-18 18:08:37 -04:00
parent 7e875aa047
commit 452abf7b43

View File

@ -1257,6 +1257,11 @@ The possible values for :attr:`~ForeignKey.on_delete` are found in
Cascade deletes. Django emulates the behavior of the SQL constraint ON Cascade deletes. Django emulates the behavior of the SQL constraint ON
DELETE CASCADE and also deletes the object containing the ForeignKey. DELETE CASCADE and also deletes the object containing the ForeignKey.
:meth:`.Model.delete` isn't called on related models, but the
:data:`~django.db.models.signals.pre_delete` and
:data:`~django.db.models.signals.post_delete` signals are sent for all
deleted objects.
* .. attribute:: PROTECT * .. attribute:: PROTECT
Prevent deletion of the referenced object by raising Prevent deletion of the referenced object by raising