#16297: unexpected behavior with make_list filter
-----------------+---------------------------------
 Reporter:  ned  |          Owner:  nobody
     Type:  Bug  |         Status:  new
Milestone:       |      Component:  Template system
  Version:  SVN  |       Severity:  Normal
 Keywords:       |   Triage Stage:  Unreviewed
Has patch:  0    |  Easy pickings:  0
    UI/UX:  0    |
-----------------+---------------------------------
 When using the make_list filter I would expect the following code to print
 'foo' on the first iteration. But the conditional fails.

 {{{
 {% for i in 12345|make_list %}
 {{i}}:
 {% if 1 == i %}foo{% endif %}
 {% endfor %}
 }}}

 Forcing the variable i to be an int with the following hack makes it work,
 but from reading the make_list documentation I thought it should already
 be an integer.

 {{{
 {% if 1 == i|add:0 %}foo{% endif %}
 }}}

 Am I missing something about the limitations of conditionals in the
 templating system?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16297>
Django <https://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.

Reply via email to