Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.4.x] Fixed #18996 - Clarified overriden model methods not called o…

…n bulk operations

Backport of 443999a from master.
  • Loading branch information...
commit d2891d1c0751d53c10f19672ac7d232b6e5088b0 1 parent e2dea54
Tim Graham authored October 12, 2012

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. 9  docs/topics/db/models.txt
9  docs/topics/db/models.txt
@@ -761,7 +761,7 @@ built-in model methods, adding new arguments. If you use ``*args,
761 761
 **kwargs`` in your method definitions, you are guaranteed that your
762 762
 code will automatically support those arguments when they are added.
763 763
 
764  
-.. admonition:: Overriding Delete
  764
+.. admonition:: Overridden model methods are not called on bulk operations
765 765
 
766 766
     Note that the :meth:`~Model.delete()` method for an object is not
767 767
     necessarily called when :ref:`deleting objects in bulk using a
@@ -769,6 +769,13 @@ code will automatically support those arguments when they are added.
769 769
     gets executed, you can use :data:`~django.db.models.signals.pre_delete`
770 770
     and/or :data:`~django.db.models.signals.post_delete` signals.
771 771
 
  772
+    Unfortunately, there isn't a workaround when
  773
+    :meth:`creating<django.db.models.query.QuerySet.bulk_create>` or
  774
+    :meth:`updating<django.db.models.query.QuerySet.update>` objects in bulk,
  775
+    since none of :meth:`~Model.save()`,
  776
+    :data:`~django.db.models.signals.pre_save`, and
  777
+    :data:`~django.db.models.signals.post_save` are called.
  778
+
772 779
 Executing custom SQL
773 780
 --------------------
774 781
 

0 notes on commit d2891d1

Please sign in to comment.
Something went wrong with that request. Please try again.