我正在尝试用以下方式分配几个变量:
{% with 'Foo' as description 'Blah' as description_2 %}
...
{% endwith %}
有没有办法做到这一点?(它适用于两个with
)
我正在尝试用以下方式分配几个变量:
{% with 'Foo' as description 'Blah' as description_2 %}
...
{% endwith %}
有没有办法做到这一点?(它适用于两个with
)
使用新语法可以分配多个变量:
{% with description='Foo' description_2='Blah' %}
...
{% endwith %}
请参阅https://docs.djangoproject.com/en/1.4/ref/templates/builtins/#with。