Hi,
I'm trying to add table generation from within ModelDesigner, but I
have a problem:
After ModelDesigner write your new model file it need to reload the
model in order to create the tables.
But reloading the model file in TG alway result in a Traceback:
File "/Users/ronald/Documents/PYTHON/langtest/modelreload/modelreload/
controllers.py", line 8, in reloading
reload(model)
File "/Users/ronald/Documents/PYTHON/langtest/modelreload/
modelreload/model.py", line 8, in ?
class Genre(SQLObject):
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/
declarative.py", line 94, in __new__
cls.__classinit__(cls, new_attrs)
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py",
line 798, in __classinit__
classregistry.registry(cls.sqlmeta.registry).addClass(cls)
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/
classregistry.py", line 91, in addClass
'__file__', '(unknown)')))
ValueError: class Genre is already in the registry (other class is
<class 'modelreload.model.Genre'>, from the module modelreload.model
in /Users/ronald/Documents/PYTHON/langtest/modelreload/modelreload/
model.pyc; attempted new class is <class 'modelreload.model.Genre'>,
from the module modelreload.model in /Users/ronald/Documents/PYTHON/
langtest/modelreload/modelreload/model.pyc)
I there a way to flush the sqlobject registry before reloading the
model?
Cheers
Ronald
________________________________
Ronald Jaramillo
mail: ronald AT checkandshare DOT com
blog: http://www.checkandshare.com/blog