So unfortunately I find myself in the situation where I need to modify an existing Pylons application to handle URLs that provide multiple parameters with the same name. Something like the following... domain:port/action?c=1&v=3&c=4
Conventionally the parameters are accessed this way...
from pylons import request
c = request.params.get("c")
#or
c = request.params["c"]
This will return "4" as the value in either case, because ignoring all but the last value seems to be the standard behavior in these situations. What I really need though, is to be able to access both. I tried printing out request.params and get something like this...
NestedMultiDict([(u'c', u'1'),(u'v', u'3'),(u'c', u'4')])
I haven't found a way to index into it, or access that first value for c.
I found a similar question relating to this problem, but solved with PHP:
Something along these lines would work well for me, but maybe some Python code that would fit into Pylons. Has anyone dealt with something like this before?