On Mon, Jul 6, 2009 at 7:24 AM, afrotypa<[email protected]> wrote:
>
> how do you set up routes to match a url structure with query strings
> where the route variables can appear in any position in the query
> string?
>
> i.e. which route will match all 3 of these urls and cause the
> controller/action to be called with var1=1, var2=2, var3=3?
>
> /controller/action/?var1=1&var2=2&var3=3
> /controller/action/?var2=2&var1=1&var3=3
> /controller/action/?var3=3&var2=2&var1=1
Routes does not look at the query string, only the URL path. There is
no way to pass query parameters as action arguments.
Well, you could theoretically set a callback function
"map.connect(..., condition={'function': MY_FUNC})", and it could
parse the query string and stuff the variables into the match dict.
But I don't know if webob is set up at that point so you'd have to do
it manually.
--
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
-~----------~----~----~----~------~----~------~--~---