[SQL-CVS] r772 - trunk/SQLObject/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2005-05-06 16:11:35
|
Author: ianb Date: 2005-05-06 16:11:25 +0000 (Fri, 06 May 2005) New Revision: 772 Modified: trunk/SQLObject/sqlobject/dbconnection.py Log: Handle access from class (where obj is None, type is class) Modified: trunk/SQLObject/sqlobject/dbconnection.py =================================================================== --- trunk/SQLObject/sqlobject/dbconnection.py 2005-05-06 16:10:41 UTC (rev 771) +++ trunk/SQLObject/sqlobject/dbconnection.py 2005-05-06 16:11:25 UTC (rev 772) @@ -812,7 +812,7 @@ # I'm a little surprised we have to do this, but apparently # the object's private dictionary of attributes doesn't # override this descriptor. - if obj.__dict__.has_key('_connection'): + if obj and obj.__dict__.has_key('_connection'): return obj.__dict__['_connection'] return self.getConnection() |