[英]How to access(loop through) queryset passed from views to html template inside javascript block in django?
我想循环遍历从视图传递到 django 中 html 模板的数组/查询集
{% block js %}
块,有可能吗?
{% block js %}
I want to access array/queryset/value passed from views here
{% endblock %}
是的,你可以这样,
{% for item in array %}
{{ item }}
<br>
{% endfor %}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.