mirror of
https://github.com/django/django.git
synced 2024-11-29 22:56:46 +01:00
Clarified that Model.delete() isn't called as a result of a cascading delete.
This commit is contained in:
parent
b47552b445
commit
5c6316dc34
@ -835,9 +835,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
|
||||
|
Loading…
Reference in New Issue
Block a user