Opened 9 years ago

Closed 8 years ago

Last modified 5 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: UI/UX:

Description

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

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by Jure Vrscaj

Attachment: 7331.diff added

MultiValueDict.iteritems() patch with unittest

comment:1 Changed 8 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 8 years ago by Jure Vrscaj

Version: 0.96SVN

comment:3 Changed 8 years ago by Simon Greenhill

milestone: 1.0 alpha
Triage Stage: UnreviewedDesign decision needed

comment:4 Changed 8 years ago by Marc Garcia

milestone: 1.0 alphapost-1.0

According to ticket organization defined in http://code.djangoproject.com/wiki/VersionOneRoadmap#how-you-can-help 1.0 alpha tickets should be just features in the Must have (http://code.djangoproject.com/wiki/VersionOneRoadmap#must-have-features) list.

Change to 1.0 beta if you can make this feature be added to May be features (http://code.djangoproject.com/wiki/VersionOneRoadmap#maybe-features).

comment:5 Changed 8 years ago by Malcolm Tredinnick

milestone: post-1.01.0

Arguably a bug.

comment:6 Changed 8 years ago by Gary Wilson

Resolution: fixed
Status: assignedclosed

fixed in [8399].

comment:7 Changed 5 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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