djangosnippets.org: Latest snippets tagged with 'messages'http://djangosnippets.org/tags/messages/2008-07-31T01:54:04.299103-05:00SessionMessages
2008-07-31T01:54:04.299103-05:00beiskehttp://djangosnippets.org/snippets/930/<p>Creates a message list, but unlike the messaging system in django.contrib.auth it is session-persistent and can therefor be displayed after a redirect.</p>
Freely redistributableExtended rails flash implementation
2007-07-20T09:25:39.273826-05:00miracle2khttp://djangosnippets.org/snippets/331/<p>This is an extendend version of the Rails Flash implementation by Sean Patrick Hogan that supports different message types.</p>
<p><strong>Setting a flash message:</strong></p>
<pre><code>request.flash.error = 'Item could not be saved'
request.flash['error'] = 'Item could not be saved'
request.flash['foo'] = 'bar'
</code></pre>
<p><strong>Displaying a flash in the view:</strong></p>
<pre><code><!-- show the error …</code></pre>
Freely redistributable