Commit f1a9a8bb authored by Timo Graham's avatar Timo Graham
Browse files

[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
parent 546c77e0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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::

+6 −0
Original line number Diff line number Diff line
@@ -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
~~~~~~~~~~~~~