views:

92

answers:

1

I need to get values of these check boxes with same name through HTTP "POST".

<input type="checkbox" id="dde" name="dept[]" value="dde"/>
<input type="checkbox" id="dre" name="dept[]" value="dre"/>
<input type="checkbox" id="iid" name="dept[]" value="iid"/>

How to get these values in python using self.request.get() method?

+4  A: 

You can use request.get_all().

According to the docs it "Returns a list of values of all of the query (URL) or POST arguments with the given name, possibly an empty list."

Alex JL