summaryrefslogtreecommitdiff
path: root/django/contrib/messages/context_processors.py
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2009-12-09 16:57:23 +0000
committerLuke Plant <L.Plant.98@cantab.net>2009-12-09 16:57:23 +0000
commit25020ddb05543fff1c37d77b49bd937fd2bbb170 (patch)
treeb156768f680819c54a73a2926b81d5d84d0e2205 /django/contrib/messages/context_processors.py
parenteeb10d5f2c5375ec28b7761f9ea0fd4f1d2e4bd1 (diff)
downloaddjango-25020ddb05543fff1c37d77b49bd937fd2bbb170.tar.gz
Fixed #4604 - Configurable message passing system, supporting anonymous users
This deprecates User.message_set in favour of a configurable messaging system, with backends provided for cookie storage, session storage and backward compatibility. Many thanks to Tobias McNulty for the bulk of the work here, with contributions from Chris Beaven (SmileyChris) and lots of code review from Russell Keith-Magee, and input from many others. Also credit to the authors of various messaging systems for Django whose ideas may have been pinched :-) git-svn-id: http://code.djangoproject.com/svn/django/trunk@11804 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/messages/context_processors.py')
-rw-r--r--django/contrib/messages/context_processors.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/django/contrib/messages/context_processors.py b/django/contrib/messages/context_processors.py
new file mode 100644
index 0000000000..26cbcd5853
--- /dev/null
+++ b/django/contrib/messages/context_processors.py
@@ -0,0 +1,8 @@
+from django.contrib.messages.api import get_messages
+
+
+def messages(request):
+ """
+ Returns a lazy 'messages' context variable.
+ """
+ return {'messages': get_messages(request)}