Hi Denes,

Thanks a lot for the clarification.
That said, the >not request.function=='first'< part of the if
statement seems therefore useless, since this code is run only when
requesting the 'second' function.
Andre


On 19 août, 12:55, DenesL <denes1...@yahoo.ca> wrote:
> Hi Andre,
>
> request.function has the name of the function called
> i.e. the function part inhttp://ipadr:port/app/controller/function
>
> If request.function is always 'second' it means you are always 
> callinghttp://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