#13402 closed (invalid)
'cycle' template tag can't handle mix of single, double quotes
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 1.2-beta |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In a template, this:
{% cycle '<div class="row">', '', '' %}
produces this:
TemplateSyntaxError at /path/to-url/ Could not parse the remainder: '<div class='row'>""' from '""<div class='row'>""'
So does the reverse (encapsulating single quotes within double quotes). Triple-quoted strings also do not work.
Change History (4)
comment:1 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 15 years ago
Component: | Uncategorized → Template system |
---|
comment:3 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:4 by , 15 years ago
Oh, and some proof:
In [1]: from django.template import * In [2]: t = Template('''{% cycle '<a href="test">' '<a href="test2">' %}''') In [3]: t.render(Context()) Out[3]: u'<a href="test">'
Note:
See TracTickets
for help on using tickets.
You're incorrectly using the old format - don't use commas (see http://docs.djangoproject.com/en/1.1/ref/templates/builtins/#cycle)