You hit the nail on the head. So I'm really just misunderstanding the
tutorial. And of course, looking at the code now it makes sense,
because it only redirects to the second page if there is actually a
value in "visitor_name". Now I get it.
Thanks, folks. It's a self-facepalm. But there will
Oups you're right.
Now I remember what I didn't understand at this point, and probably
what the OP was expecting.
The book says :
"
Note that if the "second" action is ever called before a visitor name
is set, it will display "Hello anonymous" because session.visitor_name
returns None.
"
What t
>
> I'm pretty sure the first should be like this :
>
>
>
> **
>
> def first():
> if request.vars.visitor_name:
> session.visitor_name = request.vars.visitor_name
> redirect(URL('second'))
> return dict(form=form)
>
> **
>
> NOTICE THE return dict(fo
Hello again,
I'm pretty sure the first should be like this :
**
def first():
if request.vars.visitor_name:
session.visitor_name = request.vars.visitor_name
redirect(URL('second'))
return dict(form=form)
**
NOTICE THE return dict(form=form), I think it'
Hi,
I did the tutorial of the pdf last week (newest pdf of december) and
there is a missing step exactly at this spot of the PDF. (or actually
a "not so clear change which needs to be made to run the tutorial
without any issue"). I didn't know of the google groups at that time
so I didn't post the
Note the following line:
if request.vars.visitor_name:
That means it will only store the value in the session and do the redirect
if "visitor_name" is in request.vars. If you're not submitting a visitor
name, then that variable will not be in request.vars, and the conditional
branch in the co
6 matches
Mail list logo