Skip to content
Browse files

Fixed #11470 - add documentation for ModelAdmin.message_user. thanks …

…adamv.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14868 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent f0753ef commit 82f2daaf451874a37ee3e5aa5bfd806a4a130ef5 @timgraham timgraham committed
Showing with 8 additions and 0 deletions.
  1. +2 −0 docs/ref/contrib/admin/actions.txt
  2. +6 −0 docs/ref/contrib/admin/index.txt
View
2 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::
View
6 docs/ref/contrib/admin/index.txt
@@ -933,6 +933,12 @@ templates used by the :class:`ModelAdmin` views:
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
~~~~~~~~~~~~~

0 comments on commit 82f2daa

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