summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Graham <timograham@gmail.com>2010-12-11 13:58:11 +0000
committerTimo Graham <timograham@gmail.com>2010-12-11 13:58:11 +0000
commitf1a9a8bb418aaf2128b31e7b42e2c667ead8d8e8 (patch)
treef35051fce059daaa32db40fb5678c83ebf1ee132
parent546c77e0ae6a690e7ac49ba0ead75651948595cc (diff)
[1.2.X] Fixed #11470 - add documentation for ModelAdmin.message_user. thanks adamv.
Backport of r14868 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14869 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--docs/ref/contrib/admin/actions.txt2
-rw-r--r--docs/ref/contrib/admin/index.txt6
2 files changed, 8 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/actions.txt b/docs/ref/contrib/admin/actions.txt
index 86a5355b28..0fab59e3f3 100644
--- a/docs/ref/contrib/admin/actions.txt
+++ b/docs/ref/contrib/admin/actions.txt
@@ -175,6 +175,8 @@ Defining actions as methods gives the action more straightforward, idiomatic
access to the :class:`ModelAdmin` itself, allowing the action to call any of the
methods provided by the admin.
+.. _custom-admin-action:
+
For example, we can use ``self`` to flash a message to the user informing her
that the action was successful::
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index ac517e868b..b99cfdc78c 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -901,6 +901,12 @@ to show objects owned by the logged-in user::
return qs
return qs.filter(author=request.user)
+.. method:: ModelAdmin.message_user(request, message)
+
+ Sends a message to the user. The default implementation creates a message
+ using the :mod:`django.contrib.messages` backend. See the
+ :ref:`custom ModelAdmin example <custom-admin-action>`.
+
Other methods
~~~~~~~~~~~~~