列表如下。这里forloopcounter值不起作用。怎么修?请让我知道你的看法。请注意:静态索引值正常,但动态索引值不起作用(forloopcounter)
value = [
{
"pk": 1,
"Rate": [
{
"one": "one1"
},
{
"two": "two1"
}
]
},
{
"pk": 2,
"Rate": [
{
"one": "one2"
},
{
"two": "two2"
}
]
}
]
{% for i in value %}
{{i.Rate.forloopcounter.one}} # here forloopcounter value is not working
{{i.Rate.0.one}} # This is working properly. But i need dynamic index
{% endfor %}
答案 0 :(得分:0)