cycle.py
This file
Path
examples/basic/cycle.py
13 lines · 277 bytes · Python
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 0a2ac69 point at it.
switched back to explicit set for assignments. {% foo = 42 %} becomes {% set foo = 42 %} and {% foo.something() }} becomes {{ void(foo.something() }} with this commit.Armin Ronacherbefore adoption0a2ac69
lines 1–13why, one step back1from jinja2 import Environment234env = Environment(line_statement_prefix="#", variable_start_string="${", variable_end_string="}")567print env.from_string("""\8<ul>9# for item in range(10)10 <li class="${loop.cycle('odd', 'even')}">${item}</li>11# endfor12</ul>\13""").render()