#8976: {% for x, y in dictionary %} not working as documented
---------------------------------+------------------------------------------
Reporter: hlecuanda | Owner: nobody
Status: new | Milestone:
Component: Template system | Version: 1.0
Keywords: for loop dictionary | Stage: Unreviewed
Has_patch: 0 |
---------------------------------+------------------------------------------
When unpacking key: value pairs in a dict, in a foor loop, as documented
in http://docs.djangoproject.com/en/dev/ref/templates/builtins/#ttag-for ,
x gets the first character of key, y gets the second character of key.
Template Code:
{{{
{{django_version}}
Image Sizes: {{ insert_image_sizes|pprint }}
{% for compartment,inserts in insert_image_sizes %}
compartment: {{ compartment|pprint }}
inserts: {{inserts}}
{% endfor %}
insert_image_sizes.101.aaaa.1:{{ insert_image_sizes.101.aaaa.1}}
insert_image_sizes.1.1.1:{{ insert_image_sizes.1.1.1}}
}}}
Output:
{{{
1.0-final-SVN-8985
Image Sizes: {u'-': {},
u'101': {u'aaaa': (92, 169), u'bbb': (91, 169)},
u'102': {u'cccc': (53, 98), u'dddd': (53, 98)},
u'103': {},
u'104': {},
u'105': {}}
compartment: u'-'
inserts:
compartment: u'1'
inserts: 0
compartment: u'1'
inserts: 0
compartment: u'1'
inserts: 0
compartment: u'1'
inserts: 0
compartment: u'1'
inserts: 0
insert_image_sizes.101.aaaa.1:169
insert_image_sizes.1.1.1:
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/8976>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---