index.html
{% block content %}
{{playerList}}
{% for player in playerList %}
{{player.value.indexOf(0)}}
{% empty %}
<tr>
<td class="bg-light text-center font-italic" colspan="3">You haven't registered any players yet.</td>
</tr>
{% endfor %}
{% endblock %}
playerList
是一个列表列表,从views.py文件返回。
即playerList=[["chamo",'1'],["gir",'2'],["frt",'2']]
如果我想从playerList
获取“ chamo”,该如何在html文件中编写?
答案 0 :(得分:0)
您可以只做{{ player.0 }}
。