See section 4.10 in the book, "URL" -  pp. 102-103 should tell you what you
want to know.

Additionally, if you look at the table on p.97, at the end of section 4.6,
"Request" --- you will see that the request holds everything that URL needs
- you modify what you want, and so get relative action from where you were
called.

For example, if you had a login attempt where they had not yet been
activated, then you could redirect with the args (?) containing their
name/login, and forward that to a page (function) to handle valid login
attempts on account not yet activated.

Or, if you wanted to give context help for the current request, you could
structure your app so that you use what you need - for example, function:
help,  arg,  the function you came from (so you can manipulate the current
context).

The URL function within an app does a _lot_ for you.

For external URI's, yes you can just as easily redirect on a string.

Hope this helps.

- Yarko

On Sun, May 24, 2009 at 3:28 PM, Omar Munk <omar.webs...@gmail.com> wrote:

> Thanks, and indeed. I also want to know what r = request is for.
>
> 2009/5/24 weheh <richard_gor...@verizon.net>
>
>
>> redirect is meant to send the web page to a URL address. I haven't
>> tried it myself, but I assume you could say
>>    redirect("http://www.google.com";)
>> URL(r=request,f='first') will generate a url that will direct you to
>> your application's function named 'first'.
>> The URL function does the heavy lifting in terms of generating the
>> full URL path, which can often be complex to do by hand so it's quite
>> useful. Look at p. 102 in the doc for info on the URL function.
>> I'm not 100% sure that you need the r=request argument in your call.
>> Maybe someone else can elucidate on that.
>>
>> On May 24, 4:16 pm, Pynthon Pynthon <forumx...@gmail.com> wrote:
>> > Hello
>> >
>> > I'm getting confused. Can someon explain this code?
>> >
>> > redirect(URL(r = request, f = "first"))
>> >
>> > I know it says redirect to a function. But why the URL and why  the r =
>> > request. I can't find anything in the book about it.
>> >
>> > Thanks,
>> > Pynthon
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to