[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/registration/registration.py The default __setstate__ does not the right thing. Thus overwrite it to

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Dec 8 18:14:05 EST 2004


Log message for revision 28590:
  The default __setstate__ does not the right thing. Thus overwrite it to 
  make it work. This way you also do not have to delete your Data.fs 
  anymore.
  
  

Changed:
  U   Zope3/trunk/src/zope/app/registration/registration.py

-=-
Modified: Zope3/trunk/src/zope/app/registration/registration.py
===================================================================
--- Zope3/trunk/src/zope/app/registration/registration.py	2004-12-08 23:12:34 UTC (rev 28589)
+++ Zope3/trunk/src/zope/app/registration/registration.py	2004-12-08 23:14:04 UTC (rev 28590)
@@ -727,6 +727,15 @@
         self._BBB_componentPath = path
 
     componentPath = property(__BBB_getComponentPath, __BBB_setComponentPath)
+
+    def __setstate__(self, dict):
+        super(ComponentRegistration, self).__setstate__(dict)
+        # For some reason the component path is not set correctly by the
+        # default __setstate__ mechanism. 
+        if 'componentPath' in dict:
+            self._component = NULL_COMPONENT
+            self._BBB_componentPath = dict['componentPath']
+    
     ###########################################################################
 
 



More information about the Zope3-Checkins mailing list