Ticket #11470: admin-send-message.diff

File admin-send-message.diff, 1.2 KB (added by Adam Vandenberg, 9 years ago)

Draft documentation for this method.

  • docs/ref/contrib/admin/actions.txt

    diff --git a/docs/ref/contrib/admin/actions.txt b/docs/ref/contrib/admin/actions.txt
    index 86a5355..0fab59e 100644
    a b Defining actions as methods gives the action more straightforward, idiomatic 
    175175access to the :class:`ModelAdmin` itself, allowing the action to call any of the
    176176methods provided by the admin.
     178.. _custom-admin-action:
    178180For example, we can use ``self`` to flash a message to the user informing her
    179181that the action was successful::
  • docs/ref/contrib/admin/index.txt

    diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
    index 4c72cf1..63429c0 100644
    a b templates used by the :class:`ModelAdmin` views: 
    933933                    return qs
    934934                return qs.filter(author=request.user)
     936.. method:: ModelAdmin.message_user(request, message)
     938    Sends a message to the user. The default implementation posts a message
     939    using the :mod:`django.contrib.messages` backend. See the
     940    :ref:`custom ModelAdmin example <custom-admin-action>`.
    936942Other methods
Back to Top