[SQL-CVS] r998 - SQLObject/trunk/sqlobject/inheritance
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2005-09-20 20:55:26
|
Author: phd
Date: 2005-09-20 20:55:21 +0000 (Tue, 20 Sep 2005)
New Revision: 998
Modified:
SQLObject/trunk/sqlobject/inheritance/__init__.py
Log:
Aplied a patch by alexander smishlajev <al...@an...>;
the patch optimizes inheritance machinery by removing hasattr()
that calls getattr() that calls _SO_loadValue() on an every request.
Modified: SQLObject/trunk/sqlobject/inheritance/__init__.py
===================================================================
--- SQLObject/trunk/sqlobject/inheritance/__init__.py 2005-09-20 20:48:30 UTC (rev 997)
+++ SQLObject/trunk/sqlobject/inheritance/__init__.py 2005-09-20 20:55:21 UTC (rev 998)
@@ -163,7 +163,7 @@
#DSM: If we are updating a child, we should never return a child...
if childUpdate: return val
#DSM: If this class has a child, return the child
- if hasattr(val, 'childName'):
+ if 'childName' in cls.sqlmeta.columns:
childName = val.childName
if childName is not None:
return val._childClasses[childName].get(id, connection=connection, selectResults=childResults)
|