Django

Code

Ticket #7331 (closed: fixed)

Opened 6 months ago

Last modified 4 months ago

QueryDict.iteritems behaves differently than QueryDict.items

Reported by: keturn Assigned to: jurev
Milestone: 1.0 Component: Core framework
Version: SVN Keywords:
Cc: Triage Stage: Design decision needed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

7331.diff (1.1 kB) - added by jurev on 06/24/08 10:54:05.
MultiValueDict?.iteritems() patch with unittest

Change History

06/24/08 10:54:05 changed by jurev

  • attachment 7331.diff added.

MultiValueDict?.iteritems() patch with unittest

06/24/08 10:58:13 changed by jurev

  • status changed from new to assigned.
  • needs_better_patch changed.
  • needs_tests changed.
  • owner changed from nobody to jurev.
  • needs_docs changed.
  • has_patch set to 1.

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

06/24/08 11:21:07 changed by jurev

  • version changed from 0.96 to SVN.

06/25/08 07:18:38 changed by Simon Greenhill

  • stage changed from Unreviewed to Design decision needed.
  • milestone set to 1.0 alpha.

06/27/08 09:56:13 changed 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).

08/10/08 12:57:56 changed by mtredinnick

  • milestone changed from post-1.0 to 1.0.

Arguably a bug.

08/15/08 21:18:28 changed by gwilson

  • status changed from assigned to closed.
  • resolution set to fixed.

fixed in [8399].


Add/Change #7331 (QueryDict.iteritems behaves differently than QueryDict.items)




Change Properties
Action