On Jul 20, 10:42 pm, [EMAIL PROTECTED] wrote:
> this ain't SA issue, but if u want a solution, u have to provide more
> data, and do some prints here-there.
>
> > When a scheduled job is run, its specified module is loaded using
> > __import__ . This works fine unless the loaded module has an
> > 'import model' in it. If so, I get this:
> > Traceback (most recent call last):
> > File "C:\Projects\VOR\tg\vor\jobs.py", line 210, in runJob
> > module = __import__(modname)
> > File "C:\Projects\VOR\tg\vor\account.py", line 4, in ?
> > import model
> > File "C:\Projects\VOR\tg\vor\model.py", line 11, in ?
> > Column("content", Unicode)
> > File "build\bdist.win32\egg\sqlalchemy\schema.py", line 128, in
> > __call__
> > ArgumentError: Table 'None.keyed_file' is already defined for this
> > MetaData instance.
>
> so AFAIget it, runJOB is the starter. And the module u try to import
> is 'account'?
> put a
> print 'XX',__name__
> on first line of model.py. if u see more than one 'XX', then the
> module is being loaded multiple times, probably via different
> names/paths, e.g. as model.py, vor.model.py - and u'll see the path.
Yes. here's what I see after putting in the print as you suggested:
[EMAIL PROTECTED] vor]$ sudo ./start-vor.py prod.cfg
XX vor.model
XX model
XX model
The first one is 'vor.model' for the static import declaration in one
of the files of the application.
The other 2 are from the dynamic __import__ of the runJob function,
which ran twice in this test.
So, what's up with the vor.model thing? If that is how it is being
loaded, how do I avoid reloading it as 'model'?
In other words, should I first attempt to __import__('vor.'+modname)
in runJob() ?
I'm still a bit of a python newbie.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---