From d5970df38e78958e732ee628ed8ced45f58f0b84 Mon Sep 17 00:00:00 2001 From: Timo Graham Date: Mon, 27 Dec 2010 23:47:14 +0000 Subject: [PATCH] [1.2.X] Fixed #12313 - Add a note that QuerySet.delete() doesn't necessarily call obj.delete(). thanks FunkyELF for the suggestion. Backport of r15071 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15072 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/topics/db/models.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/topics/db/models.txt b/docs/topics/db/models.txt index 457b86b912..f90a8d177b 100644 --- a/docs/topics/db/models.txt +++ b/docs/topics/db/models.txt @@ -751,6 +751,14 @@ 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 + + Note that the :meth:`~Model.delete()` method for an object is not + necessarily called when :ref:`deleting objects in bulk using a + QuerySet`. To ensure customized delete logic + gets executed, you can use :data:`~django.db.models.signals.pre_save` + and/or :data:`~django.db.models.signals.post_save` signals. + Executing custom SQL --------------------