I am creating a persistent job scheduler utility in my TG application 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. 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. 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. The 'None.keyed_file' Table referenced in the traceback 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? I've been authorized to pay $100 for a working solution to this problem. Thanks, Jesse --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---