#3100: Support for arguments on intermediate tag tokens (ex. {% if arg %}{% elif
arg %}{% endif %})
---------------------------------------------------------------+------------
Reporter: Eric Van Dewoestine <[email protected]> | Owner:
adrian
Status: reopened | Milestone:
Component: Template system | Version:
SVN
Resolution: | Keywords:
Stage: Accepted | Has_patch:
1
Needs_docs: 1 | Needs_tests:
0
Needs_better_patch: 1 |
---------------------------------------------------------------+------------
Changes (by mk):
* needs_docs: 0 => 1
* needs_tests: 1 => 0
Comment:
A differentiation between intermediate tags which accept arguments and
tags who don't seems to be necessary to support this use case properly
(without breaking backwards-compatibility or deleting tests).
The attached patch adds another argument to django.template.Parser.parse;
parse_until is complemented by parse_until_args_allowed. The included if-
tag supporting {% elif %} makes use of this. The previously deleted "extra
endblock" tests have been restored and they pass, as they should.
The documentation about writing custom tags would have to be extended for
this, though.
--
Ticket URL: <http://code.djangoproject.com/ticket/3100#comment:14>
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.