[web2py] Re: Previous location

2010-05-05 Thread Chris
That works. Thank you On May 5, 3:27 pm, Jonathan Lundell wrote: > On May 5, 2010, at 12:16 PM, Chris wrote: > > > How would you get thecurrenturllocation? > > Generally speaking, you want to use URL(r=request, args=request.args, > vars=request.vars), or something like that (I may not have all t

Re: [web2py] Re: Previous location

2010-05-05 Thread Jonathan Lundell
On May 5, 2010, at 12:16 PM, Chris wrote: > How would you get the current url location? Generally speaking, you want to use URL(r=request, args=request.args, vars=request.vars), or something like that (I may not have all the spelling right). That will not include the host part of the URL, whi

[web2py] Re: Previous location

2010-05-05 Thread Chris
How would you get the current url location? I've tried to build the current url using request.env.http_host + request.env.path_info, but it doesn't take into account routes.py. For example using that method returns 127.0.0.1:8000/init/default/ contact, but I want it to return http://127.0.0.1:800

Re: [web2py] Re: Previous location

2010-05-03 Thread Jonathan Lundell
> On Mon, May 3, 2010 at 11:08 PM, Jonathan Lundell wrote: > web2py probably isn't setting referer on a redirect, and if it did, you'd > have to interpret the URL. > > No. If I have no redirect and call a location with no args the referer is not > set when I arrive at web2py's default "Interna

Re: [web2py] Re: Previous location

2010-05-03 Thread Miguel Lopes
On Mon, May 3, 2010 at 11:08 PM, Jonathan Lundell wrote: > web2py probably isn't setting referer on a redirect, and if it did, you'd > have to interpret the URL. No. If I have no redirect and call a location with no args the referer is not set when I arrive at web2py's default "Internal error" p

Re: [web2py] Re: Previous location

2010-05-03 Thread Jonathan Lundell
web2py probably isn't setting referer on a redirect, and if it did, you'd have to interpret the URL. How about putting the previous location in session before you redirect? On Mon, May 3, 2010 at 3:05 PM, Miguel Lopes wrote: > request.env.http_referer is not working for me. > I checked (http://

Re: [web2py] Re: Previous location

2010-05-03 Thread Miguel Lopes
request.env.http_referer is not working for me. I checked (http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z14) and the referer is optionally set by the client. So we can not take it for granted. Miguel On Mon, May 3, 2010 at 10:45 PM, mr.freeze wrote: > I'm not sure if it's reliable or safe

[web2py] Re: Previous location

2010-05-03 Thread mr.freeze
I'm not sure if it's reliable or safe but request.env.http_referer might be what you're looking for. On May 3, 4:39 pm, Miguel Lopes wrote: > Is there a way to find the previous location / address in an action? > > For example: > Currently inwww.domain.com/a/c/f/arg1 > Follow some link to action_