[1.8.x] Clarified that Model.delete() isn't called as a result of a cascading delete.

Backport of 5c6316dc34 from master
This commit is contained in:
David Sanders 2015-09-29 12:09:57 +10:00 committed by Tim Graham
parent f79682eaf2
commit 07e594bba2
1 changed files with 5 additions and 3 deletions

View File

@ -825,9 +825,11 @@ code will automatically support those arguments when they are added.
Note that the :meth:`~Model.delete()` method for an object is not
necessarily called when :ref:`deleting objects in bulk using a
QuerySet<topics-db-queries-delete>`. To ensure customized delete logic
gets executed, you can use :data:`~django.db.models.signals.pre_delete`
and/or :data:`~django.db.models.signals.post_delete` signals.
QuerySet <topics-db-queries-delete>` or as a result of a :attr:`cascading
delete <django.db.models.ForeignKey.on_delete>`. To ensure customized
delete logic gets executed, you can use
:data:`~django.db.models.signals.pre_delete` and/or
:data:`~django.db.models.signals.post_delete` signals.
Unfortunately, there isn't a workaround when
:meth:`creating<django.db.models.query.QuerySet.bulk_create>` or