Hi,

is there any shorter solution for mapping routes with optional variables
in the middle of the url.
So if controller and action is missed in url, both should be set to
default and controller should not become the sc:sc part.

I use the following at the moment but the routes would become quite
complex if I have to continue like this:

    map.connect('sc/:controller/:action/:id/sc:sc', controller='index',
action='index', sc=None, requirements=dict(controller='[^\d/]+',
action='[^\d/]+', id='\d+', sc='[a-zA-Z0-9]+[a-zA-Z].[a-zA-Z0-9]*?'))
    map.connect('sc/:controller/:action/sc:sc', controller='index',
action='index', sc=None, requirements=dict(controller='[^\d/]+',
action='[^\d/]+', sc='[a-zA-Z0-9]+[a-zA-Z].[a-zA-Z0-9]*?'))
    map.connect('sc/:controller/:id/sc:sc', controller='index',
action='index', sc=None, requirements=dict(controller='[^\d/]+',
id='\d+', sc='[a-zA-Z0-9]+[a-zA-Z].[a-zA-Z0-9]*?'))
    map.connect('sc/:controller/sc:sc', controller='index',
action='index', sc=None, requirements=dict(controller='[^\d/]+',
sc='[a-zA-Z0-9]+[a-zA-Z].[a-zA-Z0-9]*?'))
    map.connect('sc/sc:sc', controller='index', action='index', sc=None,
requirements=dict(sc='[a-zA-Z0-9]+[a-zA-Z].[a-zA-Z0-9]*?'))

Thanks
Markus



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to