diff options
| author | Timo Graham <timograham@gmail.com> | 2010-12-11 13:51:14 +0000 |
|---|---|---|
| committer | Timo Graham <timograham@gmail.com> | 2010-12-11 13:51:14 +0000 |
| commit | 82f2daaf451874a37ee3e5aa5bfd806a4a130ef5 (patch) | |
| tree | d9e16616964acb2cf9a0358430f6436bba7e6aa5 | |
| parent | f0753ef211f0349bc8f94959c1f88edbac9758db (diff) | |
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
| -rw-r--r-- | docs/ref/contrib/admin/actions.txt | 2 | ||||
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 6 |
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 4c72cf127d..97ea03bad2 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/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 ~~~~~~~~~~~~~ |
