#5865: cycle template tag should accept a single argument
------------------------+---------------------------------------------------
Reporter: gwilson | Owner: munhitsu
Status: reopened | Component: Template system
Version: SVN | Resolution:
Keywords: | Stage: Accepted
Has_patch: 1 | Needs_docs: 1
Needs_tests: 0 | Needs_better_patch: 1
------------------------+---------------------------------------------------
Changes (by gwilson):
* needs_better_patch: 0 => 1
* needs_docs: 0 => 1
Comment:
Your cycle20 test case should not raise a `TemplateSyntaxError`, but
rather should output "r" since a string is iterable. A
`TemplateSyntaxError` should only be raised if the syntax for the tag in
not correct, i.e. `{% cycle colors as %}`. If the object passed is not
iterable, the template tag should fail silently and return an empty
string. Also, your patch should allow any iterable instead of just lists.
I also don't see a reason that we should be exposing the internal state of
the tag. Could you explain your reasoning for wanting to do that?
--
Ticket URL: <http://code.djangoproject.com/ticket/5865#comment:9>
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
-~----------~----~----~----~------~----~------~--~---