﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20840	Messaging framework to include namespaces	Giggaflop	nobody	"Often I am working on building forms where a file is submitted and processed server side, I then return results upon the response as part of the django messaging framework. 

I have often noticed that if the request fails but messages have been added to the messaging stack, that they will display at the next opportunity elsewhere on the site. much to the confusion of my users. 

I propose adding namespaces to Django messaging such that whenever I'm pushing messages intended for specific sections of my site, they will only display there. 

Example view code:

{{{
def push_global_message:
    # Note lack of a namespace, this is exactly as current functionality
    messages.warning(request, 'Three credits remain in your account.')

def push_targeted_message:
    # Note how i have included a namespace now to target the message and a TTL to expire the message
    messages.success(request, 'Your file upload has been received and will be processed shortly.', namespace=""file_upload"", ttl=10)
}}}

Example template code:


{{{
{% if messages %}
<ul class=""messages"">
    {% for message in messages.namespace.file_upload %}
    <li{% if message.tags %} class=""{{ message.tags }}""{% endif %}>{{ message }}</li>
    {% endfor %}
</ul>
{% endif %}
}}}"	New feature	closed	contrib.messages	1.5	Normal	wontfix			Unreviewed	0	0	0	0	0	0
