#9154: Huge improvements in templates rendering
--------------------------------------+-------------------------------------
          Reporter:  msaelices        |         Owner:  msaelices
            Status:  new              |     Milestone:           
         Component:  Template system  |       Version:  SVN      
        Resolution:                   |      Keywords:           
             Stage:  Unreviewed       |     Has_patch:  1        
        Needs_docs:  0                |   Needs_tests:  0        
Needs_better_patch:  0                |  
--------------------------------------+-------------------------------------
Comment (by msaelices):

 I've found and fixed the error. It's caused when you have this kind of
 base template:
 {{{
 # base.html
 <html>
 <body>
 {% block wrapper %}
   Lorem ipsum...
   {% block content %}
   {% endblock %}
 {% endblock %}
 </body>
 </html>

 # first.html
 {% extends "base.html" %}
 {% block wrapper %}
   Foo content.
 {% endblock %}

 # second.html
 {% extends "base.html" %}
 {% block content %}
   Bar content.
 {% endblock %}
 }}}

 The problem exists because child rendering replaces
 {{{compiled_parent.nodelist}}} enterely. The first link, and
 {{{first.html}}} rendering, put on cache a {{{base.html}}} template with
 only one block node name {{{wrapper}}}. In second link, when
 {{{second.html}}} gets rendered, block {{{content}}} doesn't exists in
 cached compiled parent, and fails silently without changing nothing.

 I fixed that making a deepcopy of compiled_parent :-)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9154#comment:6>
Django <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to