I'd just like to point out, that couldn't he also do this:
return dict(form2=form2, form1=form1)

then in the view you can have this:
{{=form1}} {{=form2}}


On Friday, January 18, 2013 10:04:22 AM UTC-7, Anthony wrote:
>
> If you go to the URL /yourapp/default/index, when the index.html view is 
> executed, it will only have available to it whatever is returned by the 
> index() function in the default.py controller. If you want to display the 
> form created in the display_form() action, you have to create a 
> /views/default/display_form.html view, insert {{=form}} there, and then go 
> to the URL /yourapp/default/display_form. It might help if you read the 
> section on 
> dispatching<http://web2py.com/books/default/chapter/29/04#Dispatching>
> .
>
> Anthony
>
> On Friday, January 18, 2013 11:54:46 AM UTC-5, Alex Glaros wrote:
>>
>> I (1) created the "person" table in models, (2) typed in the function 
>> displayed in my original post in the controller, then (3) inserted 
>> {{=form}} in /views/default/index.html but receive this error:
>>
>> <type 'exceptions.NameError'> name 'form' is not defined
>> I'm just trying to make the example in the documentation work so that the 
>> person table works/appears on the html view.
>>
>> thanks,
>>
>> Alex
>>
>> On Friday, January 18, 2013 7:01:29 AM UTC-8, DenesL wrote:
>>>
>>>
>>> Hi Alex,
>>>
>>> it is exactly that form, the one returned in the dictionary by the 
>>> display_form function.
>>>
>>> There is nothing wrong with other functions returning the same variable 
>>> unless you use them in the same view.
>>> Normally each function has its own view.
>>>
>>> Denes
>>>
>>

-- 



Reply via email to