Hi Andre,

request.function has the name of the function called
i.e. the function part in
http://ipadr:port/app/controller/function

If request.function is always 'second' it means you are always calling
http://yourserverip:port/yourapp/default/second

Hope this helps,
Denes

On Aug 19, 2:33 am, dederocks <dediro...@gmail.com> wrote:
> Hello,
>
> I want to give web2py a try, and so experiment as I follow the online
> web2py book.
> Chapter 3, section 'Postbacks', code snipet:
>
> if not request.function=='first' and not session.visitor_name:
>     redirect(URL('first'))
>
> Does not appear to work as expected. request.function always returns
> 'second'. Is this normal? My understanding was that request.function
> should return the caller's url?
> In other words, changing the above code to:
>
> if not request.function=='first':
>     redirect(URL('first'))
>
> Always sends you to the first page.
>
> Sincerely,
>
> Andre

Reply via email to