Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#7331 closed (fixed)

QueryDict.iteritems behaves differently than QueryDict.items

Reported by: Kevin Turner Owned by: Jure Vrscaj
Component: Core (Other) Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The values returned by QueryDict.items() are single values, but the values returned by QueryDict.iteritems() are lists.
We found this out from

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 11 years ago.
MultiValueDict.iteritems() patch with unittest

Download all attachments as: .zip

Change History (8)

Changed 11 years ago by Jure Vrscaj

Attachment: 7331.diff added

MultiValueDict.iteritems() patch with unittest

comment:1 Changed 11 years ago by Jure Vrscaj

Has patch: set
Owner: changed from nobody to Jure Vrscaj
Status: newassigned

Warning: The patch might break compatibility with code that depends on the problematic behaviour.

comment:2 Changed 11 years ago by Jure Vrscaj

Version: 0.96SVN

comment:3 Changed 11 years ago by Simon Greenhill

milestone: 1.0 alpha
Triage Stage: UnreviewedDesign decision needed

comment:4 Changed 11 years ago by Marc Garcia

milestone: 1.0 alphapost-1.0

According to ticket organization defined in 1.0 alpha tickets should be just features in the Must have ( list.

Change to 1.0 beta if you can make this feature be added to May be features (

comment:5 Changed 11 years ago by Malcolm Tredinnick

milestone: post-1.01.0

Arguably a bug.

comment:6 Changed 11 years ago by Gary Wilson

Resolution: fixed
Status: assignedclosed

fixed in [8399].

comment:7 Changed 7 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top