Jorge Vargas wrote:
> you can set up a call on the bottom of your model.py to make that call.
> http://www.sqlobject.org/SQLObject.html#creating-and-dropping-tables
> although that will eliminate all middle tables
Thanks for the suggestion!
I actually ended up doing the following at the end of model.py:
classNames = set(locals())
for clsName in list(classNames):
cls = locals()[clsName]
if (isinstance(cls, type) and issubclass(cls, SQLObject)
and cls is not SQLObject
and cls is not InheritableSQLObject):
if hasattr(cls, 'createTableArgs'):
cls.createTable(ifNotExists=True, **cls.createTableArgs)
else:
cls.createTable(ifNotExists=True)
else:
classNames.remove(clsName)
That lets me set createTableArgs for a given class to something like {
'createJoinTables': False } while not changing the defaults more than
need be.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---