>>>> from routes import *
>>>> m = Mapper()
>>>> m.connect('gallery_thumb', 'images/gallery/:(image_id)_thumbnail.jpg')
>>>> m.connect('gallery', 'images/gallery/:(image_id).jpg')
>>>> url_for('gallery_thumb', image_id=1)
> '/images/gallery/1_thumbnail.jpg'
>>>> url_for('gallery', image_id=1)
> '/images/gallery/1_thumbnail.jpg'
I also do not understand why it is implemented this way.
Out of curiosity I debugged through routes and it seems that
in case named route is used, routes:
- locate the route by name
- extracts arguments from this route
- abandons the route
- generates url as if no name was given
:-OOOO
Easy workaround is to name parameters differently, the following work
as expected:
from routes import *
m = Mapper()
m.debug = True
m.connect('gallery_thumb', 'images/gallery/:(image_id)_thumbnail.jpg')
m.connect('gallery', 'images/gallery/:(img_id).jpg')
print url_for('gallery_thumb', image_id=1)
print url_for('gallery', img_id=1)
But I have the feeling that something is really wrong here...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---