Skip to content

Commit

Permalink
Fixed #12313 - Add a note that QuerySet.delete() doesn't necessarily …
Browse files Browse the repository at this point in the history
…call obj.delete(). thanks FunkyELF for the suggestion.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15071 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
timgraham committed Dec 27, 2010
1 parent 5ba961e commit 08cec1f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/topics/db/models.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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<topics-db-queries-delete>`. 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
--------------------

Expand Down

0 comments on commit 08cec1f

Please sign in to comment.