You have to do: db.define_table('name',...,migrate=settings.migrate)
The table has to be defined because web2py needs to know how to map SQL types into web2py types. The migrate argument, when set to False, will prevent the "CREATE TABLE". Anyway, web2py does not "CREATE TABLE" if it exists already. Massimo On Dec 30, 3:22 am, Joseph Jude <ceph...@gmail.com> wrote: > Let us say I have the below code in db.py under models > > define_table(db, ....) > > If I change that to, > if settings.migrate: > define_table(db,...) > > rest of the queries based on this table doesn't work. I want to skip the > definition altogether if the table is already present. Reason: I assume > that GAE makes a datastore call for each of these define_table. So every > page request initiates these define_table adding to the cost of datastore > read limits posed in GAE. Is this how it happens? Can I skip definition of > tables altogether? (I believe django doesn't invoke definition of tables > for every request) > > Objective is to optimize application on GAE. > > Thank you, > Joseph