On Wed, May 25, 2011 at 05:51:15AM -0700, Geoff wrote:
> >
> > Sorry, I didn't see you were using Pylons 1.0, so my answer is actually
> > useless.
>
> Actually your answer is proving to be very useful, it got me thinking
> about the pylons routes dispatcher which is an area of pylons to which
> I have given very little attention. All I need to do is write a rule
> that matches the static path /xxx and then removes it. I don't know if
> this is possible with routes but I feel it must be so I'm going to
> give that a go and see if it works.

Myabe this will work, but it looks a bit clumsy in my opinion...
Actually, if nothing is already present in Pylons for that (and I do
believe there's already something), all the informations you need are in
the WSGI environment, which should be in the `request` object, namely
the "PATH_INFO" and maybe "SCRIPT_NAME" too, athough I can't tell you
exactly howto compute those informations

AFAIK, Pylons' request is a subclass of WebOb and you should have a look
there since WebOb's Request objects know all those variables and have
methods to generate URL as well.
Take a look at http://pythonpaste.org/webob/reference.html#method-url
for example, and have a closer look to `request.relative_url()`, maybe
this is what you want.

 Jonathan

-- 
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.

Reply via email to