From 9fde42a69a56cb6c8cdfd67b07c67a1b97638f12 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Mon, 28 Oct 2013 21:52:11 +0100 Subject: Fixed #20610: Added a message level dict to contrib.message context processor. --- docs/ref/contrib/messages.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/contrib/messages.txt b/docs/ref/contrib/messages.txt index c1995b6d39..caf51d26cc 100644 --- a/docs/ref/contrib/messages.txt +++ b/docs/ref/contrib/messages.txt @@ -196,6 +196,22 @@ Even if you know there is only just one message, you should still iterate over the ``messages`` sequence, because otherwise the message storage will not be cleared for the next request. +.. versionadded:: 1.7 + +The context processor also provides a ``DEFAULT_MESSAGE_LEVELS`` variable which +is a mapping of the message level names to their numeric value:: + + {% if messages %} + + {% endif %} + Creating custom message levels ------------------------------ -- cgit v1.3