Opened 8 years ago

Closed 7 years ago

#6769 closed (duplicate)

QueryDict's iteritems() wraps lists in another list

Reported by: eric@… Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by ramiro)

When using a querydict's .iteritems(), it wraps lists into another list, but not other types, whereas __getitem__ doesn't do that:

In [1]: from django import http
In [4]: qd=http.QueryDict('', mutable=True)

In [5]: qd['foo']='bar'

In [6]: qd['foo_list']=[]

In [7]: qd['foo_list2']=[1,2,3]

In [8]: for k,v in qd.iteritems(): print k,v
foo_list [[]]
foo [u'bar']
foo_list2 [[1, 2, 3]]

In [9]: for k in qd: print k, qd[k]
foo_list []
foo bar
foo_list2 [1, 2, 3]

Change History (3)

comment:1 Changed 7 years ago by ramiro

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by programmerq

  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 7 years ago by jdunck

  • Resolution set to duplicate
  • Status changed from new to closed
  • Triage Stage changed from Design decision needed to Accepted

Dupe of #7331.

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