Author: ianb
Date: 2006-03-29 11:17:33 -0700 (Wed, 29 Mar 2006)
New Revision: 1675
Modified:
SQLObject/branches/0.7-bugfix/sqlobject/manager/command.py
Log:
Fix problem with sqlobject-admin and the changing return value of createTableSQL
Modified: SQLObject/branches/0.7-bugfix/sqlobject/manager/command.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/manager/command.py 2006-03-28 12:23:39 UTC (rev 1674)
+++ SQLObject/branches/0.7-bugfix/sqlobject/manager/command.py 2006-03-29 18:17:33 UTC (rev 1675)
@@ -836,7 +836,15 @@
+ '_' + dbName + '.sql')
if sim:
continue
- create, constraints = cls.createTableSQL()
+ # @@: This is a little hacky, but sometimes I'm getting string
+ # results here, and sometimes tuples (apparently, if the code is
+ # meant to work?), so we'll allow for both
+ result = cls.createTableSQL()
+ if isinstance(result, basestring):
+ create = result
+ constraints = []
+ else:
+ create, constraints = result
if constraints:
constraints = '\n-- Constraints:\n%s\n' % (
'\n'.join(constraints))
|