#738: tg-admin sql create command creating malformed SQL
---------------------------------+------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone:
Component: SQLObject | Version: 0.9a4
Severity: normal | Resolution:
Keywords: |
---------------------------------+------------------------------------------
Comment (by roger.demetrescu):
I don't have a decent diff tool here... and the problem seems to be with
SQLObject after all...
Try changing your sqlobject/main.py and tell me if it works:
change
{{{
def createTableSQL(cls, createJoinTables=True, connection=None,
createIndexes=True):
conn = connection or cls._connection
sql = conn.createTableSQL(cls)
if createJoinTables:
sql += '\n' + cls.createJoinTablesSQL(connection=conn)
if createIndexes:
sql += '\n' + cls.createIndexesSQL(connection=conn)
return sql
createTableSQL = classmethod(createTableSQL)
}}}
into :
{{{
def createTableSQL(cls, createJoinTables=True, connection=None,
createIndexes=True):
conn = connection or cls._connection
sql = conn.createTableSQL(cls)
if createJoinTables:
join_sql = cls.createJoinTablesSQL(connection=conn)
if join_sql:
sql = ';\n' + join_sql
if createIndexes:
index_sql = cls.createIndexesSQL(connection=conn)
if index_sql:
sql += ';\n' + index_sql
return sql
createTableSQL = classmethod(createTableSQL)
}}}
Cheers
Roger
--
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/738>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Tickets" 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-tickets
-~----------~----~----~----~------~----~------~--~---