Django(1.4)如何使用with模板标签给几个变量赋值
Django (1.4) how to use with template tag to assign several variables
我正在尝试同时分配几个变量:
{% 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。
我正在尝试同时分配几个变量:
{% 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。