Howdy,

> I am creating a persistent job scheduler utility (which BTW, I plan on
> sharing with TG ASAP) and have run into a minor issue regarding
> SqlAlchemy.
>
> 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.
>
> My understanding of  __import__ is that if it finds a module in
> sys.modules dictionary, it will simply return that module rather than
> loading it again from the file.  If so, then it appears that somehow
> this mechanism is failing. Not sure about that, but this seems to
> create a problem when it encounters the nested 'import model'
> statement.
>
> Here's the traceback:
> 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.
>
> The 'None.keyed_file' is simply the first item in the model.py file,
> if commented out, it would complain about the next item. This seems to
> be related to a ticket I found here:http://trac.turbogears.org/ticket/1380
>
> Does anyone have a grip on Python module loading, __import__ and
> SqlAlchemy that would be able to suggest what is wrong here?
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to