Reputation: 2496
I have a form which submits some data using POST, here is what I receive when I see the local variables :
data
<QueryDict: {u'movieYearTxt': [u'1234'], u'hiddenmovieId': [u''], u'movieNameTxt': [u'asd'], u'movieInfoAdd': [u'Submit'], u'genreSelect': [u'Crime', u'Historical']}>
where data = request.POST But when I try to catch genreSelected I only get "Historical",
While in the Request information I see:
POST
Variable Value
movieYearTxt u'1234'
hiddenmovieId u''
movieNameTxt u'asd'
movieInfoAdd u'Submit'
genreSelect u'Historical'
How do I catch all the values of genreSelect Django version = 1.8.6
Upvotes: 0
Views: 207
Reputation: 2817
request.POST.getlist('genreSelected')
Or you may want to use form to parse and validate POST values.
Upvotes: 2