/ Published in: Django

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# getting multiple values: testargs = request.GET.getlist('testargs') # getlist gets all parameters with same name!!!! # constructing the url: >>> from django.http import QueryDict >>> q = QueryDict(‘artists=1′).copy() >>> my_artists = [11,22,33,44] >>> q.setlist(‘artists’, my_artists) >>> print q <QueryDict: {u’artists’: [11, 22, 33, 44]}> >>> print q.urlencode() artists=11&artists=22&artists=33&artists=44
URL: http://www.djangofoo.com/93/request-post-get-multiple-values
Comments
