diff options
| author | Tomáš Ehrlich <tomas.ehrlich@gmail.com> | 2012-10-04 14:03:48 +0200 |
|---|---|---|
| committer | Tomáš Ehrlich <tomas.ehrlich@gmail.com> | 2012-10-04 14:03:48 +0200 |
| commit | 443999a1eeea70e4deebcf31f8f845696be62c3d (patch) | |
| tree | 425ed2b3b78faf1858996fc51369eee753701ddf /docs/topics | |
| parent | 934f35f1f958f48a36eff64b13e43a9d55a476e0 (diff) | |
Fixed #18996 - Docs on overriden model methods
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/db/models.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/topics/db/models.txt b/docs/topics/db/models.txt index f29cc28332..0b7c9d389d 100644 --- a/docs/topics/db/models.txt +++ b/docs/topics/db/models.txt @@ -762,7 +762,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 @@ -770,6 +770,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 -------------------- |
