[SQL-CVS] r3261 - in SQLObject/branches/0.9: docs sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2008-02-27 13:34:55
|
Author: phd Date: 2008-02-27 06:34:50 -0700 (Wed, 27 Feb 2008) New Revision: 3261 Modified: SQLObject/branches/0.9/docs/Authors.txt SQLObject/branches/0.9/docs/News.txt SQLObject/branches/0.9/sqlobject/main.py Log: A patch by Diez B. Roggisch <deets at web.de>: Prevent MultipleJoin from removing the intermediate table if it was not created by the Join. Modified: SQLObject/branches/0.9/docs/Authors.txt =================================================================== --- SQLObject/branches/0.9/docs/Authors.txt 2008-02-27 13:33:23 UTC (rev 3260) +++ SQLObject/branches/0.9/docs/Authors.txt 2008-02-27 13:34:50 UTC (rev 3261) @@ -21,6 +21,7 @@ * Shahms King <shahms at shahms.com> * David Turner, The Open Planning Project * Dan Pascu <dan at ag-projects.com> +* Diez B. Roggisch <deets at web.de> * Oleg Broytmann <ph...@ph...> .. image:: http://sourceforge.net/sflogo.php?group_id=74338&type=4 Modified: SQLObject/branches/0.9/docs/News.txt =================================================================== --- SQLObject/branches/0.9/docs/News.txt 2008-02-27 13:33:23 UTC (rev 3260) +++ SQLObject/branches/0.9/docs/News.txt 2008-02-27 13:34:50 UTC (rev 3261) @@ -7,6 +7,12 @@ .. _start: +SQLObject 0.9.4 +=============== + +* Prevent MultipleJoin from removing the intermediate table if it was not + created by the Join. + SQLObject 0.9.3 =============== Modified: SQLObject/branches/0.9/sqlobject/main.py =================================================================== --- SQLObject/branches/0.9/sqlobject/main.py 2008-02-27 13:33:23 UTC (rev 3260) +++ SQLObject/branches/0.9/sqlobject/main.py 2008-02-27 13:34:50 UTC (rev 3261) @@ -1410,9 +1410,6 @@ def createJoinTables(cls, ifNotExists=False, connection=None): conn = connection or cls._connection for join in cls._getJoinsToCreate(): - if not getattr(join, 'createRelatedTable', True): - # This join has requested not to be created - continue if (ifNotExists and conn.tableExists(join.intermediateTable)): continue @@ -1423,9 +1420,6 @@ conn = connection or cls._connection sql = [] for join in cls._getJoinsToCreate(): - if not getattr(join, 'createRelatedTable', True): - # This join has requested not to be created - continue sql.append(conn._SO_createJoinTableSQL(join)) return ';\n'.join(sql) createJoinTablesSQL = classmethod(createJoinTablesSQL) @@ -1453,7 +1447,7 @@ for join in cls.sqlmeta.joins: if not join: continue - if not join.hasIntermediateTable(): + if not join.hasIntermediateTable() or not getattr(join, 'createRelatedTable', True): continue if join.soClass.__name__ > join.otherClass.__name__: continue @@ -1466,7 +1460,7 @@ for join in cls.sqlmeta.joins: if not join: continue - if not join.hasIntermediateTable(): + if not join.hasIntermediateTable() or not getattr(join, 'createRelatedTable', True): continue if join.soClass.__name__ > join.otherClass.__name__: continue |