tags:

views:

921

answers:

1

Hopefully this is an easy one.
Problem: Django QueryDict wraps values in lists.

This:

data[u'test'] = [u'1', u'2']

Becomes:

<QueryDict: {u'test': [[u'1', u'2']]}>

How do I make it:

<QueryDict: {u'test': [u'1', u'2']}>
+4  A: 

Do you mean?

data.setlist( 'test', [u'1', u'2'] )

http://docs.djangoproject.com/en/dev/ref/request-response/?from=olddocs#django.http.QueryDict.setlist

S.Lott
Brilliant, thank you so much!
dmi
Sorry: not brilliant. Just more patient at searching the documentation.
S.Lott
Can't deny it's a RTFM question and I missed this method in the docs :)
dmi
@dmi: Don't blame me as brilliant -- patient, perhaps.
S.Lott