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 >> > --