Opened 17 years ago

Closed 16 years ago

Last modified 13 years ago

#7331 closed (fixed)

QueryDict.iteritems behaves differently than QueryDict.items

Reported by: Kevin Turner Owned by: Jure Vrscaj
Component: Core (Other) Version: dev
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

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

Download all attachments as: .zip

Change History (8)

by Jure Vrscaj, 17 years ago

Attachment: 7331.diff added

MultiValueDict.iteritems() patch with unittest

comment:1 by Jure Vrscaj, 17 years ago

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 by Jure Vrscaj, 17 years ago

Version: 0.96SVN

comment:3 by Simon Greenhill, 17 years ago

milestone: 1.0 alpha
Triage Stage: UnreviewedDesign decision needed

comment:4 by Marc Garcia, 17 years ago

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 by Malcolm Tredinnick, 16 years ago

milestone: post-1.01.0

Arguably a bug.

comment:6 by Gary Wilson, 16 years ago

Resolution: fixed
Status: assignedclosed

fixed in [8399].

comment:7 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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