Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A workaround for Django QueryDict wrapping values in lists?

Tags:

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']}>
like image 875
dmi Avatar asked Mar 06 '09 12:03

dmi


1 Answers

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

like image 91
S.Lott Avatar answered Sep 23 '22 13:09

S.Lott