I agree that the "as" clause makes me expect it to render nothing, but it has worked this way at least back to 1.0, so I guess changing it is not an option.
On Wed, Jul 7, 2010 at 11:55 AM, ringemup <ringe...@gmail.com> wrote: > Er, that was sloppy of me. Actual output: > > <ul> > a > <li>a</li> > b > <li>b</li> > a > <li>a</li> > </ul> > > On Jul 7, 11:53 am, ringemup <ringe...@gmail.com> wrote: >> I thought that {% cycle 'a' 'b' as mycycle %} was supposed to just set >> the variable {{ mycycle }} and not output anything to the template. >> >> However, the following template (with myrange=[1, 2, 3]): >> >> {* start template *} >> <ul> >> {% for i in myrange %} >> {% cycle 'a' 'b' as mycycle %} >> <li>{{ mycycle }}</li> >> {% endfor %} >> </ul> >> {* end template *} >> >> outputs: >> >> <ul> >> 1 >> <li>1</li> >> 2 >> <li>2</li> >> 3 >> <li>3</li> >> </ul> >> >> Is this a bug or the desired behavior? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.