Hi, i can actually confirm that i don't get the error when all models are in
the same module. Any ideas?
On Wed, Mar 30, 2011 at 3:57 PM, eric cire 371c@gmail.com wrote:
After investigating further, i have the impression that the problem occurs
when models are in different modules
This is just the way Python works - code inside a module is only
executed when that module is imported. If you don't import
myapp.models.notes, then the class definitions never get executed.
One solution is to import all the sub-modules in your bootstrap.py
before calling create_all. Another is
Actually that helps alot and i had infact resolved to and was in the
process of doing so (i know that about python modules.. ;) but i
might be missing something)
But, why does this work in the context of an application (eg. pylons
app). Basically, calling Base.create_all() in some init_db
Actually that helps alot and i had infact resolved to and was in the
process of doing so (i know that about python modules.. ;) but i
might be missing something)
But, why does this work in the context of an application (eg. pylons
app). Basically, calling Base.create_all() in some init_db
Something else must be importing those modules when run from pylons. If you
really want to know how they are getting imported, stick something in the
module which will raise an exception when it is imported (eg type blah blah
blah at the top of the module) and look at the traceback.
Cheers,