google-code-export / dojango

Automatically exported from code.google.com/p/dojango
Other
1 stars 0 forks source link

Template tag set_dojango_context doesn't work anymore #76

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Upgrade Django to at least r15304
2. In your template include "dojango/include.html"

What is the expected output? What do you see instead?
DOJANGO variable is not available in context outside dojango/include.html as it 
used to be. So if in my base tamplete I got {% include 'dojango/include.html' 
%} I cannot do <body class="{{DOJANGO.THEME}}"> etc.

What version of the product are you using? On what operating system?
Dojango trunk, Django r15304, python2.7

Please provide any additional information below.

Ithink this change can be a reason http://code.djangoproject.com/changeset/14922

Little explanation: RequestContext works as a stack. If you modify the context 
inside custom template tag, than the new dictionary is added on top of context 
stack. After template tag is rendered this dictionary is pop'ed from the stack. 

Original issue reported on code.google.com by zim...@gmail.com on 9 Feb 2011 at 4:56

GoogleCodeExporter commented 9 years ago
You can easily fix that if you also set the context in the template where you 
want to use {{ DOJANGO.THEME }}:

{% set_dojango_context %}

Is that working for you?

Original comment by tobias.k...@googlemail.com on 14 Apr 2011 at 10:38