>
> 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's what is missing at 
> this step in the book (one page later it's corrected with the 
> FORM(INPUT()) form creation technic. 
>

No, in that particular example, the form is not defined in the controller 
at all. If you do "return dict(form=form)", you will get an error, because 
"form" has not been defined. In this case, the form is defined in the view. 
The first() function simply receives the form post and checks whether 
"visitor_name" is one of the variables in the post -- otherwise, it simply 
returns the first.html view, which includes the empty form.

Anthony
 

Reply via email to