Update of /cvsroot/sqlobject/SQLObject/SQLObject
In directory sc8-pr-cvs1:/tmp/cvs-serv3719/SQLObject
Modified Files:
SQLObject.py
Log Message:
* Use the instance's connection in joins.
* Allow connection option to selects.
Index: SQLObject.py
===================================================================
RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLObject.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** SQLObject.py 24 May 2003 20:48:50 -0000 1.36
--- SQLObject.py 24 May 2003 20:53:36 -0000 1.37
***************
*** 995,999 ****
cls = findClass(self.otherClass, registry=inst._registry)
me = self.callingClass
! ids = me._connection._SO_intermediateJoin(
self.intermediateTable,
self.otherColumn,
--- 995,999 ----
cls = findClass(self.otherClass, registry=inst._registry)
me = self.callingClass
! ids = inst._connection._SO_intermediateJoin(
self.intermediateTable,
self.otherColumn,
***************
*** 1004,1008 ****
def remove(self, inst, other):
me = self.callingClass
! me._connection._SO_intermediateDelete(
self.intermediateTable,
self.joinColumn,
--- 1004,1008 ----
def remove(self, inst, other):
me = self.callingClass
! inst._connection._SO_intermediateDelete(
self.intermediateTable,
self.joinColumn,
***************
*** 1013,1017 ****
def add(self, inst, other):
me = self.callingClass
! me._connection._SO_intermediateInsert(
self.intermediateTable,
self.joinColumn,
--- 1013,1017 ----
def add(self, inst, other):
me = self.callingClass
! inst._connection._SO_intermediateInsert(
self.intermediateTable,
self.joinColumn,
***************
*** 1051,1054 ****
--- 1051,1057 ----
return self.clone(groupBy=groupBy)
+ def connection(self, conn):
+ return self.clone(connection=conn)
+
def limit(self, limit):
return self[:limit]
***************
*** 1098,1105 ****
def __iter__(self):
! return self.sourceClass._connection.iterSelect(self)
def __len__(self):
! count = self.sourceClass._connection.countSelect(self)
if self.ops.get('start'):
count -= self.ops['start']
--- 1101,1110 ----
def __iter__(self):
! conn = self.ops.get('connection', self.sourceClass._connection)
! return conn.iterSelect(self)
def __len__(self):
! conn = self.ops.get('connection', self.sourceClass._connection)
! count = conn.countSelect(self)
if self.ops.get('start'):
count -= self.ops['start']
|