Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#7331 closed (fixed)

QueryDict.iteritems behaves differently than QueryDict.items

Reported by: keturn Owned by: jurev
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 jurev 7 years ago.
MultiValueDict.iteritems() patch with unittest

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by jurev

MultiValueDict.iteritems() patch with unittest

comment:1 Changed 7 years ago by jurev

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to jurev
  • Patch needs improvement unset
  • Status changed from new to assigned

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

comment:2 Changed 7 years ago by jurev

  • Version changed from 0.96 to SVN

comment:3 Changed 7 years ago by Simon Greenhill

  • milestone set to 1.0 alpha
  • Triage Stage changed from Unreviewed to Design decision needed

comment:4 Changed 7 years ago by garcia_marc

  • milestone changed from 1.0 alpha to post-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 7 years ago by mtredinnick

  • milestone changed from post-1.0 to 1.0

Arguably a bug.

comment:6 Changed 7 years ago by gwilson

  • Resolution set to fixed
  • Status changed from assigned to closed

fixed in [8399].

comment:7 Changed 4 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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