diff options
author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-05-14 02:35:16 +0000 |
---|---|---|
committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-05-14 02:35:16 +0000 |
commit | 5bdee2556e9f6b32dee8bb25ffc9594a3cb23472 (patch) | |
tree | 91623b00b5e2dc25172f1a61f1452783ac1613e0 | |
parent | e508bfd27f34fc753ae32cc1776251e2d7f36610 (diff) | |
download | django-5bdee2556e9f6b32dee8bb25ffc9594a3cb23472.tar.gz |
Fixed #11022: documented that the admin bulk delete action calls `QuerySet.delete()`, not `Model.delete()`. Thanks, Idan Gazit.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10780 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r-- | docs/ref/contrib/admin/actions.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/actions.txt b/docs/ref/contrib/admin/actions.txt index 7b664f901d..904d20eb33 100644 --- a/docs/ref/contrib/admin/actions.txt +++ b/docs/ref/contrib/admin/actions.txt @@ -23,7 +23,20 @@ models. For example, here's the user module from Django's built-in :mod:`django.contrib.auth` app: .. image:: _images/user_actions.png + +.. warning:: + + The "delete selected objects" action uses :meth:`QuerySet.delete() + <django.db.models.QuerySet.delete>` for efficiency reasons, which has an + important caveat: your model's ``delete()`` method will not be called. + If you wish to override this behavior, simply write a custom action which + accomplishes deletion in your preferred manner -- for example, by calling + ``Model.delete()`` for each of the selected items. + + For more background on bulk deletion, see the documentation on :ref:`object + deletion <topics-db-queries-delete>`. + Read on to find out how to add your own actions to this list. Writing actions |