Ben, thanks a lot for reply, I suspected that it is something about uniqueness of the name of the route, but I think that it was a good feature we heavily used in our project. Why not treat name of the route as alias and do the same as for unnamed routes - find the most suitable one. It was so in 1.9, and I think we were not the ones who used this. And it makes our migration to 0.9.7 Pylons a real pain.
Do you think it brakes the design of the Routes somehow? If not why not make it more flexible? Regards, Mykola On Apr 23, 1:36 am, Ben Bangert <[email protected]> wrote: > On Apr 22, 2009, at 12:41 PM, mickolka wrote: > > > I have two rules > > > map.connect('company_site_local', 'cs:(id)-:(company_name)/v: > > (vacancy_id)-:(vacancy_title).html', controller='member', > > action='vacancy_view', requirements=dict(id='\d+', vacancy_id='\d+')) > > map.connect('company_site_local', 'cs:(id)-: > > (company_name)/:action', controller='member', requirements=dict(id='\d > > +', action='.+')) > > Already, that's bad. Named routes should be *unique*. You named two > routes by the same name, so the last one will be the one always used > during generation. Naming the routes is so that you can use that > *specific* route, so its utility is somewhat ambiguous when using the > same name for multiple routes. > > > But if I add one more rule to the bottom > > map.connect('company_site_local', 'cs:(id)-: > > (company_name)/:action', controller='member', requirements=dict(id='\d > > +', action='.+')) > > map.connect('company_site_local', 'cs:(id)-:(company_name)/v: > > (vacancy_id)-:(vacancy_title).html', controller='member', > > action='vacancy_view', requirements=dict(id='\d+', vacancy_id='\d+')) > > map.connect('company_site_local', 'cs:(id)-:(company_name)', > > controller='member', action='home', requirements=dict(id='\d+')) > > Yea, as I mentioned, its because you're using the same name for them > all. Name them uniquely, and it'll be used. > > Cheers, > Ben > > smime.p7s > 3KViewDownload --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
