期待:1→001
stringformat
<td class="">{{e.branch_no|stringformat:'03i'}}</td> →001
<td class="">{{e.branch_no|stringformat:'04i'}}</td> →0001
1 != '1' 字符和数字相等的判定
payment_method.code : integer
appl.payment_method : string
<select id="payment_method">
{% for op in payment_method %}
<option value="{{op.code}}"
{%if op.code|stringformat:"i" == appl.payment_method %}
selected {% endif %}>{{op.name}}</option>
{% endfor %}
</select>
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。