django - collecting data from a HTML <select>
问题 I've seen a couple of documents on how to collect the data from a HTML statement in Django but none of them were very clear to me. Does anybody have a real working example to share? In my case I have something like this in my template file: <select title="my_options"> <option value="1">Select value 1</option> <option value="2">Select value 2</option> </select> What goes in the views.py in order to collect the selected value? Thank you! 回答1: If it's a GET request, request.GET['my_options'] .