我正在尝试分配几个变量:
{% with 'Foo' as description 'Blah' as description_2 %}
...
{% endwith %}
有没有办法实现这个目标? (它适用于两个with
)
答案 0 :(得分:4)
使用新语法分配多个变量:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.28/angular.min.js"></script>
<div ng-app="myApp">
<pre ng-controller='myCtrl'>{{results|json}}</pre>
</div>
请参阅https://docs.djangoproject.com/en/1.4/ref/templates/builtins/#with。