I've got some routes that point to URLs in the public directory, so
they're only for h.url_for and not for incoming URL matching. I have
them listed after my regular named routes and Pylons default mappings:
map.connect("stylesheet", "/default.css")
map.connect("attachment", "/attachments/:orr_id/:entry_id/:filename",
requirements={"orr_id": NUMERIC, "entry_id": NUMERIC})
map.connect("incident_image", "/attachments/:orr_id/inews.jpg")
map.connect("missing_incident_image", "/images/no_incident_image.jpg")
map.connect("meatball", "/images/meatball.png")
The problem is,
h.url_for("missing_incident_image") => "/default.css"
h.url_for("meatball") => "/default.css"
In other words, it's returning the value of the first route without a
controller or :placeholder, rather than the correct named route.
I put _static=True on the "stylesheet", "missing_incident_image", and
"meatball" routes, and that seems to work. But I can't put
_static=True on the "attachment" or "incident_image" routes or it
won't substitute the placeholder; I get nonsense like
"/attachments/:orr_id/inews.jpg?orr_id=2".
Why does routes work this way?
Ben blogged earlier about an improvement to static routes that would
eliminate the schizophrenic nature of _static. Is that coming any
time soon?
--
Mike Orr <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---