On Apr 22, 2009, at 12:41 PM, mickolka wrote:
I have two rulesmap.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
Description: S/MIME cryptographic signature
