Groups
Sign in
Groups
Django users
Conversations
About
Send feedback
Help
'for' statements with five words should end in 'reversed': for key, value in obj.items
311 views
Skip to first unread message
Salim Fadhley
unread,
Apr 18, 2008, 6:33:13 AM
4/18/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
When rendering this template:
{% block objcontent %}
{% for key, value in obj.items %}
<tr>
<td>{{ key }}
</td>
<td>{{ repr(value) }}
</td>
</tr>
{% endfor %}
{% endblock objcontent %}
I get this error:
'for' statements with five words should end in 'reversed': for key,
value in obj.items
Any idea what is going on here?
I get the same error from:
{% for ( key, value ) in obj.items() %}
Thanls
Dan Ellis
unread,
Apr 18, 2008, 7:02:33 AM
4/18/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
You can't do "key, value" in Django 0.96. You need to do "for item in
obj.items" and then use item.0 and item.1, or use a development
version.
Salim Fadhley
unread,
Apr 18, 2008, 8:13:59 AM
4/18/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Great - I upgraded to dev - it works fine.
Reply all
Reply to author
Forward
0 new messages