【发布时间】:2015-07-29 03:49:21
【问题描述】:
我有一个循环来显示烧瓶模板中的列表内容,但我不想显示元素的第一个字符,这样在 python 中有效,但在烧瓶中无效
{%for file in files%}
{% f= file['path'] %}
<p> {{ f[1:] }}</p>
{% endfor %}
我收到这个错误
TemplateSyntaxError: Encountered unknown tag 'f'. Jinja was looking for the following tags: 'endfor' or 'else'. The innermost block that needs to be closed is 'for'.
【问题讨论】: