python - How to create URL Parameters from a list -
i have form multiple select field. working through get method. example of request parameters generated form: action=not-strummed&action=not-rewarded&keywords=test&page=2 note there 2 "action" parameters. happening because of multiple select. want is: make dict parameters remove "page" key dict transform-back dict parameter string the urllib.urlencode() isn't smart enough generate url parameters list. for example: { "action": [u"not-strummed", u"not-rewarded"] } urllib.urlencode() transforms dict as: action=%5bu%27not-strummed%27%2c+u%27not-rewarded%27%5d this wrong , useless. that's why wrote iteration code re-generate url parameters. parameters_dict = dict(self.request.get.iterlists()) parameters_dict.pop("page", none) pagination_parameters = "" key, value_list in parameters_dict.iteritems(): value in value_list: pagination_item = "&%(ke