[SQL-CVS] r771 - trunk/SQLObject/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2005-05-06 16:10:56
|
Author: ianb
Date: 2005-05-06 16:10:41 +0000 (Fri, 06 May 2005)
New Revision: 771
Modified:
trunk/SQLObject/sqlobject/sresults.py
Log:
Better handling of case where no explicit ConnectionHub connection has been provided
Modified: trunk/SQLObject/sqlobject/sresults.py
===================================================================
--- trunk/SQLObject/sqlobject/sresults.py 2005-05-05 22:59:56 UTC (rev 770)
+++ trunk/SQLObject/sqlobject/sresults.py 2005-05-06 16:10:41 UTC (rev 771)
@@ -140,7 +140,10 @@
return list(self.clone(start=start, end=start+1))[0]
def __iter__(self):
- conn = self.ops.get('connection', self.sourceClass._connection)
+ if self.ops.get('connection'):
+ conn = self.opts.get('connection')
+ else:
+ conn = self.sourceClass._connection
return conn.iterSelect(self)
def accumulate(self, *expressions):
|