[SQL-CVS] r1347 - SQLObject/branches/0.7-bugfix/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2005-12-05 19:35:18
|
Author: phd
Date: 2005-12-05 19:35:11 +0000 (Mon, 05 Dec 2005)
New Revision: 1347
Modified:
SQLObject/branches/0.7-bugfix/sqlobject/joins.py
Log:
Merged revs 1345:1346 from the trunk: a patch by "j.kartnaller" <j.k...@ro...> to pass connection if there is no one.
Modified: SQLObject/branches/0.7-bugfix/sqlobject/joins.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/joins.py 2005-12-05 19:34:14 UTC (rev 1346)
+++ SQLObject/branches/0.7-bugfix/sqlobject/joins.py 2005-12-05 19:35:11 UTC (rev 1347)
@@ -246,8 +246,15 @@
SOMultipleJoin.__init__(self, **kw)
def performJoin(self, inst):
+ if inst.sqlmeta._perConnection:
+ conn = inst._connection
+ else:
+ conn = None
pythonColumn = self.soClass.sqlmeta.style.dbColumnToPythonAttr(self.joinColumn)
- results = self.otherClass.select(getattr(self.otherClass.q, pythonColumn) == inst.id)
+ results = self.otherClass.select(
+ getattr(self.otherClass.q, pythonColumn) == inst.id,
+ connection=conn
+ )
if results.count() == 0:
if not self.makeDefault:
return None
|