Fixed #18658 #529

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

Improve ModelAdmin.message_user to have an API more similar to
django.contrib.messages.add_message(), allowing setting of debug level and
using extra_tags.

Add tests.
Modify documentation.

@jezdez jezdez commented on an outdated diff Nov 17, 2012

docs/ref/contrib/admin/index.txt
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>`.
+ using the :mod:`django.contrib.messages` backend. It exposes an API similar
+ to :func:`django.contrib.messages.add_message` but accepts the
+ positional arguments in a different order to maintain backwards
+ compatibility. For convenience, it accepts the `level` argument as
+ a string rather than the ususal level number.
+ See the :ref:`custom ModelAdmin example <custom-admin-action>`.
@jezdez

jezdez Nov 17, 2012

Owner

Can you add a versionadded:: 1.5 statement for the new API?

Basically just make your addition a new paragraph and prefix it with:

.. versionadded:: 1.5
@thiderman thiderman Fixed #18658
Improve ModelAdmin.message_user to have an API more similar to
django.contrib.messages.add_message(), allowing setting of debug level and
using extra_tags.

Add tests.
Modify documentation.
20a21e8
Member

ptone commented Nov 18, 2012

Member

ptone commented Nov 20, 2012

merged in edf7ad3

ptone closed this Nov 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment