0
我正在寫一個jinja
的模板。在HTML文件中,我寫道:jinja2 gloable set does not work
{% set tmpx, tmpy = 0 %}
{% for greeting in greetings %}
{% if greeting.author %}
{% tmpx = greeting.data_x %}
{% tmpy = greeting.data_y %}
{% endif %}
{% endfor %}
結果是程序無法找到tmpx
,tmpy
。所以如何使用 全球設置感到困惑。