Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 82f2daaf451874a37ee3e5aa5bfd806a4a130ef5 1 parent f0753ef
Tim Graham authored December 11, 2010
2  docs/ref/contrib/admin/actions.txt
@@ -175,6 +175,8 @@ Defining actions as methods gives the action more straightforward, idiomatic
175 175
 access to the :class:`ModelAdmin` itself, allowing the action to call any of the
176 176
 methods provided by the admin.
177 177
 
  178
+.. _custom-admin-action:
  179
+
178 180
 For example, we can use ``self`` to flash a message to the user informing her
179 181
 that the action was successful::
180 182
 
6  docs/ref/contrib/admin/index.txt
@@ -933,6 +933,12 @@ templates used by the :class:`ModelAdmin` views:
933 933
                     return qs
934 934
                 return qs.filter(author=request.user)
935 935
 
  936
+.. method:: ModelAdmin.message_user(request, message)
  937
+
  938
+    Sends a message to the user. The default implementation creates a message
  939
+    using the :mod:`django.contrib.messages` backend. See the
  940
+    :ref:`custom ModelAdmin example <custom-admin-action>`.
  941
+
936 942
 Other methods
937 943
 ~~~~~~~~~~~~~
938 944
 

0 notes on commit 82f2daa

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