It may not be quite as reliable as recording the URL yourself, but you 
could also use request.env.http_referer.

Anthony

On Tuesday, June 4, 2013 5:48:20 PM UTC-4, Jose wrote:
>
> Hello
>
> I need to know what the last url visited (not the current url). I did 
> this, but it seems ugly. There a better way to do what I need.
>
> def previous_url():
>     if not session.previous_url:
>         session.previous_url = []
>         session.previous_url.insert(0, request.url)
>
>
>     session.previous_url.insert(0, request.url)
>     if len(session.previous_url) == 3:
>         session.previous_url.pop()
>     return session.previous_url[1]
>
>
> José
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to