[SQL-CVS] SQLObject/SQLObject SQLObject.py,1.16,1.17
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <ian...@us...> - 2003-04-08 03:01:38
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv10413/SQLObject Modified Files: SQLObject.py Log Message: Changed ifExists argument to createTable to make more sense, as ifNotExists Index: SQLObject.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLObject.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** SQLObject.py 7 Apr 2003 23:28:07 -0000 1.16 --- SQLObject.py 8 Apr 2003 03:01:34 -0000 1.17 *************** *** 778,790 **** dropTable = classmethod(dropTable) ! def createTable(cls, ifExists=False, createJoinTables=True): ! if ifExists and cls._connection.tableExists(cls._table): return cls._connection.createTable(cls) if createJoinTables: ! cls.createJoinTables(ifExists=ifExists) createTable = classmethod(createTable) ! def createJoinTables(cls, ifExists=False): for join in cls._joins: if not join.hasIntermediateTable(): --- 778,790 ---- dropTable = classmethod(dropTable) ! def createTable(cls, ifNotExists=False, createJoinTables=True): ! if ifNotExists and cls._connection.tableExists(cls._table): return cls._connection.createTable(cls) if createJoinTables: ! cls.createJoinTables(ifNotExists=ifNotExists) createTable = classmethod(createTable) ! def createJoinTables(cls, ifNotExists=False): for join in cls._joins: if not join.hasIntermediateTable(): *************** *** 796,800 **** if join.callingClass > join.otherClass: continue ! if ifExists and \ cls._connection.tableExists(join.intermediateTable): continue --- 796,800 ---- if join.callingClass > join.otherClass: continue ! if ifNotExists and \ cls._connection.tableExists(join.intermediateTable): continue |