Opened 18 years ago
Closed 18 years ago
#3351 closed (fixed)
Add block name to endblock (feature request)
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
For some large pages, I find it useful to add comments showing the names of the blocks that an "endblock" is for:
{% block outer %} .. many lines here ... {% block inner %} .. etcetera .. {% block questions %} .. a whole lot of stuff here .. {% endblock %} {# questions #} ... etc ... {% endblock %} {# inner #} ... blah ... {% endblock %} {# outer #}
The {# endblock comments #}
help me keep my sanity. What I'd like to do is write:
{% endblock questions %} ... etc ... {% endblock inner %} ... blah ... {% endblock outer %}
and have django make sure that the endblocks match with the named block. Helps with the "internal documentation" and helps me see the structure and catch cut/paste errors. The endblock naming would be purely optional, of course!
Attachments (2)
Change History (7)
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 18 years ago
Triage Stage: | Design decision needed → Accepted |
---|
by , 18 years ago
Attachment: | endblock.patch added |
---|
comment:4 by , 18 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Actually, that's probably more than a start. It works for me :)
comment:5 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This is a good idea, as long as it's optional. Anybody care to write a patch?