QueryDict.iteritems behaves differently than QueryDict.items
The values returned by QueryDict.items() are single values, but the values returned by QueryDict.iteritems() are lists.
We found this out from http://trac.openidenabled.com/trac/ticket/161
In [6]: d =QueryDict('a=1&a=2&b=3')
In [7]: d
Out[7]: <MultiValueDict: {'a': ['1', '2'], 'b': ['3']}>
In [8]: d.items()
Out[8]: [('a', '2'), ('b', '3')]
In [9]: list(d.iteritems())
Out[9]: [('a', ['1', '2']), ('b', ['3'])]
Attachments
(1)
- 7331.diff
(1.1 KB
) - added by Jure Vrscaj 17 years ago.
- MultiValueDict.iteritems() patch with unittest
Download all attachments as:
.zip
Change History
(8)
Has patch: |
set
|
Owner: |
changed from nobody to Jure Vrscaj
|
Status: |
new → assigned
|
milestone: |
→ 1.0 alpha
|
Triage Stage: |
Unreviewed → Design decision needed
|
milestone: |
1.0 alpha → post-1.0
|
milestone: |
post-1.0 → 1.0
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
MultiValueDict.iteritems() patch with unittest