這是我有:我的for循環沒有得到值
result = defaultdict(<type 'list'>,
{'USA': [{'username': 'user123', 'first-name': 'John', 'last-name': 'Doe'}],
'Europe': [{'username': 'myname654', 'first-name': 'Peter', 'last-name': 'Johnson'}]
})
這是我想
<html>
<body>
<h1> USA </h1>
<p> user123, John Doe</p>
<h1> Europe </h1>
<p> myname654, Peter Johnson</p>
</body>
</html>
我已經嘗試噸不同的for循環輸出,但沒有他們工作。
這是我有,但它不起作用。
{% for item in result %}
<h1> {{ item }} </h1>
<p> {{ result.item.username }} </p>
{% endfor %}
你能告訴我們你要使用你的for循環的代碼? – GWW 2011-01-19 20:27:29