diff options
Diffstat (limited to 'docs/ref/contrib/admin/index.txt')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 9336ce174e..38668a0a2c 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -1303,11 +1303,19 @@ templates used by the :class:`ModelAdmin` views: return qs return qs.filter(author=request.user) -.. method:: ModelAdmin.message_user(request, message) +.. method:: ModelAdmin.message_user(request, message, level=messages.INFO, extra_tags='', fail_silently=False) - 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>`. + Sends a message to the user using the :mod:`django.contrib.messages` + backend. See the :ref:`custom ModelAdmin example <custom-admin-action>`. + + .. versionadded:: 1.5 + + Keyword arguments allow you to change the message level, add extra CSS + tags, or fail silently if the ``contrib.messages`` framework is not + installed. These keyword arguments match those for + :func:`django.contrib.messages.add_message`, see that function's + documentation for more details. One difference is that the level may be + passed as a string label in addition to integer/constant. .. method:: ModelAdmin.get_paginator(queryset, per_page, orphans=0, allow_empty_first_page=True) |
