[SQL-CVS] r858 - trunk/SQLObject/sqlobject/inheritance
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2005-07-27 19:18:18
|
Author: phd
Date: 2005-07-27 19:18:12 +0000 (Wed, 27 Jul 2005)
New Revision: 858
Modified:
trunk/SQLObject/sqlobject/inheritance/__init__.py
Log:
Yet another minor inheritance optimization from alexander smishlajev -
create the object in one INSERT instead of INSERT+UPDATE.
Modified: trunk/SQLObject/sqlobject/inheritance/__init__.py
===================================================================
--- trunk/SQLObject/sqlobject/inheritance/__init__.py 2005-07-27 15:30:12 UTC (rev 857)
+++ trunk/SQLObject/sqlobject/inheritance/__init__.py 2005-07-27 19:18:12 UTC (rev 858)
@@ -194,7 +194,7 @@
if self._parentClass:
parentClass = self._parentClass
new_kw = {}
- parent_kw = {}
+ parent_kw = {'childName': self.__class__.__name__}
for (name, value) in kw.items():
if hasattr(parentClass, name):
parent_kw[name] = value
@@ -202,7 +202,6 @@
new_kw[name] = value
kw = new_kw
self._parent = parentClass(kw=parent_kw)
- self._parent.childName = self.__class__.__name__
id = self._parent.id
super(InheritableSQLObject, self)._create(id, **kw)
|