Present data from python dictionary to django template.?

后端 未结 3 989
粉色の甜心
粉色の甜心 2021-02-04 08:08

I have a dictionary

data = {\'sok\': [ [1, 10] ], \'sao\': [ [1, 10] ],\'sok&sao\':[ [2,20]] }

How Can I (Loop trough Dictionary ) pres

3条回答
  •  难免孤独
    2021-02-04 08:55

    In a project im working on now, i have had the same problem, thanks to your replies i've ended up doing something like this and it worked fine:

    
    {% for k,v in resultado.iteritems %}
        
    {% endfor %}
    
    author qty Amount
    {{ k }} {{ v[0] }} {{ v[1] }}

提交回复
热议问题