#7711: Implement a tag "Switch" for conditional rendering
--------------------------------------+-------------------------------------
Reporter: GabrielFalcao | Owner: nobody
Status: new | Milestone:
Component: Template system | Version: SVN
Resolution: | Keywords: case switch tags
template templatetag
Stage: Unreviewed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 1 |
--------------------------------------+-------------------------------------
Changes (by dc):
* needs_better_patch: => 1
* needs_tests: => 0
* needs_docs: => 0
Comment:
Better add {% enddefault %} for symmetry and consistency.
This part in do_case() is wrong:
{{{
nodelist_true = parser.parse(('else', end_tag))
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse((end_tag,))
parser.delete_first_token()
else:
nodelist_false = NodeList()
return CaseNode(bits[1], nodelist_true)
}}}
You are using nodelist_false nowhere in do_case().
--
Ticket URL: <http://code.djangoproject.com/ticket/7711#comment:1>
Django Code <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
-~----------~----~----~----~------~----~------~--~---