﻿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
4529	Allow multiple blocks with the same name in one template	Noam Raphael <spam.noam@…>	nobody	"This patch allows multiple blocks with the same name in one template as long as they have exactly the same content. It turns out that this restriction is sufficient in order to keep the block system consistent.

A simple example:

base.html:

{{{
<html>
<head>
<title>Bug System - {% block title %}Default Title{% endblock %}</title>
</head>
<body>
<h1>{% block title %}Default Title{% endblock %}</h1>
{% block body %}Default Body{% endblock %}
</body>
</html>
}}}

The template:
{{{
{% extends 'base.html' %}
{% block title %}Title!{% endblock %}
{% block body %}Body!{% endblock %}
}}}

The result:
{{{
<html>
<head>
<title>Bug System - Title!</title>
</head>
<body>
<h1>Title!</h1>
Body!
</body>
</html>
}}}

See the discussion at http://groups.google.com/group/django-developers/t/d100212a99e2a653

Two notes about the patch:

1. I moved ""add_to_builtins('django.template.loader_tags')"" from template/loader.py to {{{template/__init__.py}}}, because loader_tags wasn't loaded for me even for the SVN without my changes.

2. The change to {{{__init__.py}}} seems big, but it's mostly indentation, since I put most of the code in a try...finally block.
"	Uncategorized	closed	Template system	dev	Normal	wontfix		me@… drackett@… emh	Design decision needed	1	0	0	0	0	0
