0
我努力了神社模板环路内的if
声明偷偷声明神社:嵌套'如果“for”循环
</table>
<class="container">
<table border ="1">
<caption> BBOXX <caption>
<thead class="thead-inverse">
<tr>
<th>CU Serial</th>
<th>System</th>
<th>Version</th>
<th>Enable Status</th>
</tr>
{% for d in client_data %}
<tr>
<td>{{ d["serial_number"]}} </td>
<td>{{ d["hardware_type"]}} </td>
{% if {{ d["current_enable_flag"]}} == TRUE %}
<td> {{ON}} </td>
{% else %}
<td> {{OFF}} </td>
{% endif %}
</tr>
{% endfor %}
</table>
误差TemplateSyntaxError: expected token ':', got '}'
如果要这样:
是?
我认为你需要的':'if语句之后:'如果{{d [ “current_enable_flag”]}} == TRUE:' – numbermaniac
@numbermaniac:这是不是Python代码,不需要使用':'。 –
@MartijnPieters啊我的错误,从标签我认为“偷偷摸摸的陈述”一定是Python代码。 – numbermaniac