After upgrading to 0.9.7 I cannot make my routes config work right,
most of the issues were fixed by changing order of rules but there are
also issues that I really do not understand what the problem is
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='.+'))
and when I call
print h.url_for('company_site_local', id=23,
company_name='foo', vacancy_id=2323, vacancy_title='bar')
I get
/cs23-foo?vacancy_title=bar&vacancy_id=2323
the question is why the second rule work, not the first.
If I swap them,
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+'))
I'll get what I need
/cs23-foo/v2323-bar.html
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+'))
I get same
/cs23-foo?vacancy_title=bar&vacancy_id=2323
What am I doing wrong and if there any chance to either get it work or
get Pylons 0.9.7 to work with 1.9 routes that work really well?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---