In my model file I am importing a database definition from a module file.
This works correctly the first time after the server is started showing the
tablename and 11 rows in the table.
However for the second and subsequent requests it shows a rows object but 0
rows in the table.
It works fine if I put the model definition code inline rather than
importing.
MODEL:
import ocart2
web=ocart2.web
rows=web(web.category.category_id>0).select()
log.info((web.tables, rows))
MODULE:
from gluon import *
from config import webstring
web=DAL(webstring, pool_size=10, migrate=False, migrate_enabled=False)
web.define_table('category',
Field('category_id', 'id', notnull=True, writable=False),
Field('parent_id', 'integer', default=0, notnull=True, writable=False),
Field('status', 'integer', default=1),
Field('top', 'integer', notnull=True, writable=False))
--