[Zope-Checkins] SVN: Zope/trunk/lib/python/Shared/DC/ZRDB/ - Merge a fix from the five-integration branch, with a test.

Sidnei da Silva sidnei at awkly.org
Thu Mar 17 07:09:25 EST 2005


Log message for revision 29520:
  
  - Merge a fix from the five-integration branch, with a test.
  

Changed:
  U   Zope/trunk/lib/python/Shared/DC/ZRDB/RDB.py
  U   Zope/trunk/lib/python/Shared/DC/ZRDB/Results.py
  A   Zope/trunk/lib/python/Shared/DC/ZRDB/tests/
  _U  Zope/trunk/lib/python/Shared/DC/ZRDB/tests/__init__.py
  _U  Zope/trunk/lib/python/Shared/DC/ZRDB/tests/testResult.py

-=-
Modified: Zope/trunk/lib/python/Shared/DC/ZRDB/RDB.py
===================================================================
--- Zope/trunk/lib/python/Shared/DC/ZRDB/RDB.py	2005-03-17 09:00:56 UTC (rev 29519)
+++ Zope/trunk/lib/python/Shared/DC/ZRDB/RDB.py	2005-03-17 12:09:24 UTC (rev 29520)
@@ -141,9 +141,9 @@
             setattr(r,k,getattr(Record,k))
 
         # Add SQL Aliases
-        d=r.__dict__
         for k, v in aliases:
-            if not hasattr(r,k): d[k]=v
+            if not hasattr(r,k):
+                setattr(r, k, v)
 
         if hasattr(brains, '__init__'):
             binit=brains.__init__
@@ -152,9 +152,8 @@
                 Record.__init__(self,data)
                 binit(self.__of__(parent))
 
-            r.__dict__['__init__']=__init__
+            setattr(r, '__init__', __init__)
 
-
         self._class=r
 
         # OK, we've read meta data, now get line indexes

Modified: Zope/trunk/lib/python/Shared/DC/ZRDB/Results.py
===================================================================
--- Zope/trunk/lib/python/Shared/DC/ZRDB/Results.py	2005-03-17 09:00:56 UTC (rev 29519)
+++ Zope/trunk/lib/python/Shared/DC/ZRDB/Results.py	2005-03-17 12:09:24 UTC (rev 29520)
@@ -71,9 +71,9 @@
                 setattr(r,k,getattr(Record,k))
 
         # Add SQL Aliases
-        d=r.__dict__
         for k, v in aliases:
-            if not hasattr(r,k): d[k]=v
+            if not hasattr(r, k):
+                setattr(r, k, v)
 
         if hasattr(brains, '__init__'):
             binit=brains.__init__
@@ -83,7 +83,7 @@
                 if parent is not None: self=self.__of__(parent)
                 binit(self)
 
-            r.__dict__['__init__']=__init__
+            setattr(r, '__init__', __init__)
 
         self._class=r
 

Copied: Zope/trunk/lib/python/Shared/DC/ZRDB/tests (from rev 29493, Zope/branches/five-integration/lib/python/Shared/DC/ZRDB/tests)



More information about the Zope-Checkins mailing list