As others have mentioned, you should have 'db' set in only one place, not in
each model file (assuming it's supposed to represent the same database
connection). If you actually want to connect to two separate databases (or
even have two separate connections to the same database), then use different
names for each connection (e.g., db1 and db2).
On Saturday, January 22, 2011 1:13:15 PM UTC-5, dominatus wrote:
> Only one of my model files, workout.py, has tables which are being
> created. All other models, including db.py, are not created. I have
> been trying to figure this out for the past two days, I do not know
> why they are not working now, as they were working before.
>
> Workout.py has the same format/imports as all other files. Yet it is
> the only model file which is getting imported into the database. My
> model file messaging.py, which was working two weeks ago, is no longer
> working. I did not edit it any, it just stopped working. Any help
> would be appreciated.
>
> Workout.py heading:
>
> # coding: utf8
> db = DAL('sqlite://storage.sqlite')
>
> import os
> import datetime
>
> from gluon.tools import *
> auth = Auth(globals(),db) # authentication/
> authorization
> crud = Crud(globals(),db) # for CRUD helpers
> using auth
>
> auth.settings.hmac_key =
> 'sha512:a0bf5d13-2d97-4cea-922d-53ed1d7d6e79' # before
> define_tables()
> auth.define_tables()
>
> # Workout systems
>
>
>
>
> Messaging.py heading:
>
> # coding: utf8
> db = DAL('sqlite://storage.sqlite')
>
> from gluon.tools import *
> auth = Auth(globals(),db) # authentication/
> authorization
> crud = Crud(globals(),db) # for CRUD helpers
> using auth
>
> auth.settings.hmac_key =
> 'sha512:a0bf5d13-2d97-4cea-922d-53ed1d7d6e79' # before
> define_tables()
> auth.define_tables()
>
> #Support systems