On Wed, Dec 8, 2010 at 10:23 PM, Jonathan Gardner
<[email protected]> wrote:
> I sometimes use Route's url() to do the query args for me. For instance,
>
> url('http://google.com', q='aasdf')
>
> will give me:
>
> http://google.com?q=aasdf
>
> which is a very useful shortcut.
>
> However, I've found that this doesn't work:
>
> url('http://google.com?q=aasdf', foo='bar')
>
> which gives me:
>
> http://google.com?q=aasdf?foo=bar
>
> Does it make sense to modify Routes to parse the query before it
> applies the args in this special case? I can submit a patch.
Use ``webhelpers.util.update_params()`` to add/modify query parameters on a URL:
update_params("http://google.com/?q=aasdf", foo="bar")
update_params("http://google.com/", q="aasdf", foo="bar")
BTW, a HTTP URL without a slash after the domain is technically
invalid. The browser or library may add it for you, but it's better to
publish a complete URL.
--
Mike Orr <[email protected]>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.