Hi,

I want to setup my url mappings so that the follows urls will work:

/admin/clients/ -- > index method on ClientsController
/admin/clients/foobar -- > foobar method on ClientsController
/admin/clients/123 -- > 'view' method on ClientsController, with id passed
in
/admin/clients/123;quux -- > quux method on ClientsController, with id
passed in

After some trial runs I ended up with the following Routes setup code:

    m.connect('admin_clients', '/admin/clients/:action',
            controller='clients', action='index',
            requirements=dict(action='[a-z].*'))
    m.connect('admin_client', '/admin/clients/:id;:action',
            controller='clients', action='view',
            requirements=dict(id='\d+'))

Note the "requirements" arg -- without them it confuses the too, even though
the urls can always be differentiated with ";".

I wonder, if there is a way to simplify my routes code? Say, expressing
these two rules as a single rule.

Max.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
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