summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-07-03 17:56:43 +0000
committerJannis Leidel <jannis@leidel.info>2011-07-03 17:56:43 +0000
commit332a485567420e844887344b6429d3b4db4b260b (patch)
treebb3d1eb5cd17546c0ebdd29848804314bbf0017b /docs
parentf9fe112f2d65ea187ad47b280197664b551f339e (diff)
Fixed #16115 -- Added ModelAdmin.save_related method to be able to do pre- or post-save operations for objects related to the parent object currently displayed. Thanks, Julien Phalip.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16498 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/admin/index.txt10
-rw-r--r--docs/releases/1.4.txt7
2 files changed, 17 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index 4b472e71f0..43057a31b0 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -978,6 +978,16 @@ templates used by the :class:`ModelAdmin` views:
else:
return ['name']
+.. method:: ModelAdmin.save_related(self, request, form, formsets, change)
+
+ .. versionadded:: 1.4
+
+ The ``save_related`` method is given the ``HttpRequest``, the parent
+ ``ModelForm`` instance, the list of inline formsets and a boolean value
+ based on whether the parent is being added or changed. Here you can do any
+ pre- or post-save operations for objects related to the parent. Note
+ that at this point the parent object and its form have already been saved.
+
.. method:: ModelAdmin.get_readonly_fields(self, request, obj=None)
.. versionadded:: 1.2
diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt
index 20f1ba63cf..781093123c 100644
--- a/docs/releases/1.4.txt
+++ b/docs/releases/1.4.txt
@@ -80,6 +80,13 @@ to work similarly to how desktop GUIs do it. The new hook
:meth:`~django.contrib.admin.ModelAdmin.get_ordering` for specifying the
ordering dynamically (e.g. depending on the request) has also been added.
+``ModelAdmin.save_related()``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A new :meth:`~django.contrib.admin.ModelAdmin.save_related` hook was added to
+:mod:`~django.contrib.admin.ModelAdmin` to ease the customization of how
+related objects are saved in the admin.
+
Tools for cryptographic signing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~