After looking at this, there's nothing special about blocks compared to any other node. They could just as well be evaluated at render time.
Here's a branch that implements this change: https://github.com/prestontimmons/django/compare/conditional-blocks?expand=1 Before returning blocks into block_context to be used as overrides, it loops through any if nodes and checks the conditions. The one case that's kinda funny is if you do something like: {% if var %} {% block content %}...{% endblock %} {% else %} {% block content %}...{% endblock %} {% endif %} Currently, the second block node will raise a TemplateSyntaxError because it's defined twice. Does that matter? -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" 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]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/71aa2d20-d162-4620-b4c6-8cb915a1da5d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
