I'm writing a python webapp (on Google AppEngine, using webob) that should process a form containing a list of addresses.
To simplify, lets say the form contains these inputs:
<input type="hidden" name="address[]" value="1" />
<input type="hidden" name="address[]" value="2" />
<input type="hidden" name="address[]" value="3" />
<input type="hidden" name="address[]" value="4" />
Now, Rails\PHP would parse this to a single 'address' value containing a list [1,2,3,4]. Is there a simple way to do this in Python?
from inside a RequestHandler method,
self.request.params.getall('address[]')
will return a list of the values. The [] is of no significance though, the fields could just as easily be named 'address'.