Author: phd
Date: 2010-04-09 12:10:56 -0600 (Fri, 09 Apr 2010)
New Revision: 4159
Modified:
SQLObject/branches/0.11/docs/News.txt
SQLObject/branches/0.11/sqlobject/main.py
Log:
Fixed a bug in replacing self._connection in the case no previous self._connection has been set.
Modified: SQLObject/branches/0.11/docs/News.txt
===================================================================
--- SQLObject/branches/0.11/docs/News.txt 2010-04-09 18:10:07 UTC (rev 4158)
+++ SQLObject/branches/0.11/docs/News.txt 2010-04-09 18:10:56 UTC (rev 4159)
@@ -7,6 +7,12 @@
.. _start:
+SQLObject 0.11.5
+================
+
+* Fixed a bug in replacing self._connection in the case no previous
+ self._connection has been set.
+
SQLObject 0.11.4
================
Modified: SQLObject/branches/0.11/sqlobject/main.py
===================================================================
--- SQLObject/branches/0.11/sqlobject/main.py 2010-04-09 18:10:07 UTC (rev 4158)
+++ SQLObject/branches/0.11/sqlobject/main.py 2010-04-09 18:10:56 UTC (rev 4159)
@@ -922,7 +922,8 @@
# If no connection was given, we'll inherit the class
# instance variable which should have a _connection
# attribute.
- if (connection is not None) and (self._connection is not connection):
+ if (connection is not None) and \
+ (getattr(self, '_connection', None) is not connection):
self._connection = connection
# Sometimes we need to know if this instance is
# global or tied to a particular connection.
@@ -1209,7 +1210,7 @@
# Pass the connection object along if we were given one.
if kw.has_key('connection'):
connection = kw.pop('connection')
- if self._connection is not connection:
+ if getattr(self, '_connection', None) is not connection:
self._connection = connection
self.sqlmeta._perConnection = True
|