> > I'm not sure why tables entries inserted from index() is persistent but > not tables defined from index(). >
Because those are two different operations. When you enter data into a db table, you are storing the data in the database itself, so obviously it will be persistent. When you define a DAL table using db.define_table(...), you are simply specifying a model of your data -- the table definition tells the DAL about your database table so the DAL knows how to insert, update, and select data from the database (as well as validate data submitted via forms, etc.). The table definition is not part of the database -- it is simply a Python object created by your application code and therefore only persists during the request in which it is created. If you create a table definition in the "index" function of the default.py controller, it will only be available in that function. When you load appadmin, you are making a separate request to the appadmin.py controller, so it does not see the table definition made in the earlier request to your "index" function. This is the same with any Python object created during a given request -- it will not be available in other requests (unless re-created, or explicitly persisted via caching, session, etc.). Anthony