Re: Pyramid modify query parameter of current url

2011-03-20 Thread oO
Thanks. I ended up needing to take into account request.view_name as well. I should probably also look for path components after the view_name, and restore those as well. url = [context + view_name + path_elements ] + query_dict I guess another way is to just use the scriptname + query_dict. I

Pyramid modify query parameter of current url

2011-03-18 Thread oO
What would be the best way to modify only one of the query parameters of the current url without modifying anything else? I have a query based pagination in a mako template, and I want it to only modify the page=X part of the url, without having to know anything about the current view, or the

Re: Pyramid modify query parameter of current url

2011-03-18 Thread Michael Merickel
The query parameter to resource url expects a list of 2-tuples, coincidentally the same as what is returned by request.GET.items(). I'd suggest: qs = dict(request.GET) qs['page'] = 2 url = resource_url(context, request, query=qs.items()) This is untested, but it is not far off from