我正在玩jinja模板,突然发现DateTime字段比较有一些错误。然后尝试简单的数字比较,如下所示:
{% if (5+6) > 1 %}
<p> This will display if the condition is true </p>
{% endif %}但它显示error like (对于这个if条件):
TemplateSyntaxError at /examevent/
Could not parse the remainder: '(5+6)' from '(5+6)'为什么会发生这种情况,以及如何修复它?
发布于 2021-08-09 12:01:36
试试这个:%}->-%}和{%->{%-
{% if (5+6) > 1 -%}
<p> This will display if the condition is true </p>
{%- endif %}https://stackoverflow.com/questions/68711651
复制相似问题