#24847: Items set on a RequestContext after creation get lost
---------------------------------+--------------------
Reporter: pmdhazy | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------
You cannot use `c['foo'] = newvalue` on a RequestContext after creation
as it gets stomped on by the different context processors logic in 1.8
{{{
>>> from django.template import Template, RequestContext
>>> from django.http import HttpRequest
>>> r = HttpRequest()
>>> c = RequestContext(r, {'a': 'AAA'})
>>> t = Template('a is <{{a}}> and b is <{{b}}>')
>>> c['b'] = 'BBB'
>>> t.render(c)
u'a is <AAA> and b is <>'
}}}
In the above note that 'b' is not rendered in the template.
--
Ticket URL: <https://code.djangoproject.com/ticket/24847>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.6d5ee196cf11d8feec0b97749df7f0e7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.