summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2012-10-12 16:45:45 -0700
committerTim Graham <timograham@gmail.com>2012-10-12 19:46:47 -0400
commitd2891d1c0751d53c10f19672ac7d232b6e5088b0 (patch)
tree7853cdee28de63bfca600b906fdeeb63d0ec9137 /docs
parente2dea54efe53fbeb66e684973ed6ad05f63969cc (diff)
[1.4.x] Fixed #18996 - Clarified overriden model methods not called on bulk operations
Backport of 443999a1eeea70e4deebcf31f8f845696be62c3d from master.
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/db/models.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/topics/db/models.txt b/docs/topics/db/models.txt
index 60d3a7016f..a0b7416a4d 100644
--- a/docs/topics/db/models.txt
+++ b/docs/topics/db/models.txt
@@ -761,7 +761,7 @@ built-in model methods, adding new arguments. If you use ``*args,
**kwargs`` in your method definitions, you are guaranteed that your
code will automatically support those arguments when they are added.
-.. admonition:: Overriding Delete
+.. admonition:: Overridden model methods are not called on bulk operations
Note that the :meth:`~Model.delete()` method for an object is not
necessarily called when :ref:`deleting objects in bulk using a
@@ -769,6 +769,13 @@ code will automatically support those arguments when they are added.
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
+ :meth:`updating<django.db.models.query.QuerySet.update>` objects in bulk,
+ since none of :meth:`~Model.save()`,
+ :data:`~django.db.models.signals.pre_save`, and
+ :data:`~django.db.models.signals.post_save` are called.
+
Executing custom SQL
--------------------