我有一个循环来显示烧瓶模板中的列表内容,但我不想显示元素的第一个字符,这样在python中工作但不在烧瓶中
{%for file in files%}
{% f= file['path'] %}
<p> {{ f[1:] }}</p>
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
我收到这个错误
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'.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1808 次 |
| 最近记录: |