diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2010-11-21 19:00:40 +0000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2010-11-21 19:00:40 +0000 |
| commit | 274aba3b9b8c48012a2d842790cb3df04dc9ae80 (patch) | |
| tree | c7986494f0b0e22060f6c53644fb9e352a72aafe /docs/ref | |
| parent | 0cf1c96d062f64275c5babc7687b301f0bfa3bc6 (diff) | |
Fixed #11108 -- added ModelAdmin.delete_model, a hook with which to perform custom pre-post delete behavior. Thanks to Florian Apolloner for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14673 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index ac517e868b..cc918be922 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -757,6 +757,12 @@ templates used by the :class:`ModelAdmin` views: ``ModelAdmin`` methods ---------------------- +.. warning:: + + :meth:`ModelAdmin.save_model` and :meth:`ModelAdmin.delete_model` must + save/delete the object, they are not for veto purposes, rather they allow + you to perform extra operations. + .. method:: ModelAdmin.save_model(self, request, obj, form, change) The ``save_model`` method is given the ``HttpRequest``, a model instance, @@ -770,6 +776,13 @@ For example to attach ``request.user`` to the object prior to saving:: obj.user = request.user obj.save() +.. method:: ModelAdmin.delete_model(self, request, obj) + +.. versionadded:: 1.3 + +The ``delete_model`` method is given the ``HttpRequest`` and a model instance. +Use this method to do pre- or post-delete operations. + .. method:: ModelAdmin.save_formset(self, request, form, formset, change) The ``save_formset`` method is given the ``HttpRequest``, the parent |
