var*_*lon 18 django django-templates
我在Django模板中排队太长了
{% for some_item, some_another_item, again_some_another_item_with_long_name in items %}
Run Code Online (Sandbox Code Playgroud)
我该怎么分裂呢?
使用\或仅拆分不起作用.
如果你真的想保留那些讨厌的长名字,我会做的是:
{% for a, b, c in items %}
{% with a as some_item %}
{% with b as some_another_item %}
{% with c as again_some_another_item_with_long_name %}
bla bla bla ..
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2991 次 |
| 最近记录: |