【发布时间】:2015-06-10 15:14:23
【问题描述】:
我正在尝试用 :
分配多个变量{% with 'Foo' as description 'Blah' as description_2 %}
...
{% endwith %}
有什么方法可以实现吗? (它适用于两个with)
【问题讨论】:
标签: django templates templatetag
我正在尝试用 :
分配多个变量{% with 'Foo' as description 'Blah' as description_2 %}
...
{% endwith %}
有什么方法可以实现吗? (它适用于两个with)
【问题讨论】:
标签: django templates templatetag
使用新语法可以分配多个变量:
{% with description='Foo' description_2='Blah' %}
...
{% endwith %}
见https://docs.djangoproject.com/en/1.4/ref/templates/builtins/#with。
【讨论】: