Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #11022: documented that the admin bulk delete action calls `Que…

…rySet.delete()`, not `Model.delete()`. Thanks, Idan Gazit.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10780 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5bdee2556e9f6b32dee8bb25ffc9594a3cb23472 1 parent e508bfd
Jacob Kaplan-Moss authored May 14, 2009

Showing 1 changed file with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. 13  docs/ref/contrib/admin/actions.txt
13  docs/ref/contrib/admin/actions.txt
@@ -23,7 +23,20 @@ models. For example, here's the user module from Django's built-in
23 23
 :mod:`django.contrib.auth` app:
24 24
 
25 25
 .. image:: _images/user_actions.png
  26
+
  27
+.. warning::
  28
+
  29
+    The "delete selected objects" action uses :meth:`QuerySet.delete()
  30
+    <django.db.models.QuerySet.delete>` for efficiency reasons, which has an
  31
+    important caveat: your model's ``delete()`` method will not be called.
26 32
     
  33
+    If you wish to override this behavior, simply write a custom action which
  34
+    accomplishes deletion in your preferred manner -- for example, by calling
  35
+    ``Model.delete()`` for each of the selected items.
  36
+    
  37
+    For more background on bulk deletion, see the documentation on :ref:`object
  38
+    deletion <topics-db-queries-delete>`.
  39
+
27 40
 Read on to find out how to add your own actions to this list.
28 41
 
29 42
 Writing actions

0 notes on commit 5bdee25

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