编程小白想请教个问题
django 模板里面用了嵌套for循环
比如{1,2,3}{a,b,c}
目标{1,a}{2,b}{3,c}
结果成了
{1,a}{2,a}{3,a}
{1,b}{2,b}{3,b}
{1,c}{2,c}{3,c}
其中一个for循环用了regroup 也就是有3个for循环
该怎么写
{% for ele in eles %}
{% regroup ns by ele_id as ns_list %}
{% for nu in ns_list %}
<table>
<tbody>
<tr>
<td width="40%" align="center" rowspan="10">
<img src="{{ MEDIA_URL }}{{ ele.imageB }}" width="100" height="100" alt="limian"/>
</td>
<td width="10%">序号</td>
<td width="10%">标准宽度</td>
<td width="10%">标准高度</td>
<td width="10%">测量宽度</td>
<td width="10%">测量高度</td>
</tr>
{% for n in nu.list %}
<tr align="center">
<td>{{ n.stanum }}</td>
<td>{{ n.stad }}</td>
<td>{{ n.stah }}</td>
<td>{{ n.mead }}</td>
<td>{{ n.meah }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
{% endfor %}