[Zope-CVS] CVS: Products/Ape/lib/apelib/zope2 - classifier.py:1.5 ofsserial.py:1.5

Shane Hathaway shane@zope.com
Wed, 30 Jul 2003 18:11:49 -0400


Update of /cvs-repository/Products/Ape/lib/apelib/zope2
In directory cvs.zope.org:/tmp/cvs-serv11553/lib/apelib/zope2

Modified Files:
	classifier.py ofsserial.py 
Log Message:
Fixed backward compatibility.

Class names now use a dot instead of a colon to qualify the module name.
The conversion to the new syntax was not done early enough until now.

Made the object ID serializer handle classes that switch between storing
the ID in the '__name__' and the 'id' attribute.



=== Products/Ape/lib/apelib/zope2/classifier.py 1.4 => 1.5 ===
--- Products/Ape/lib/apelib/zope2/classifier.py:1.4	Wed Jul 30 17:33:17 2003
+++ Products/Ape/lib/apelib/zope2/classifier.py	Wed Jul 30 18:11:42 2003
@@ -124,6 +124,10 @@
             return {'mapper_name': mapper_name}, mapper_name
         classification, serial = self.gw.load(event)
         class_name = classification.get('class_name')
+        if class_name and ':' in class_name:
+            # Backward compatibility
+            class_name = class_name.replace(':', '.')
+            classification['class_name'] = class_name
         mapper_name = classification.get('mapper_name')
         if mapper_name is None:
             # bw compat: look for certain meta_types.


=== Products/Ape/lib/apelib/zope2/ofsserial.py 1.4 => 1.5 ===
--- Products/Ape/lib/apelib/zope2/ofsserial.py:1.4	Thu Jul 10 09:27:42 2003
+++ Products/Ape/lib/apelib/zope2/ofsserial.py	Wed Jul 30 18:11:42 2003
@@ -163,7 +163,9 @@
     def deserialize(self, object, event, state):
         attrname = self.getAttrNameFor(object)
         setattr(object, attrname, state)
-        event.notifyDeserialized(attrname, state)
+        # Allow references under either attribute name.
+        event.notifyDeserialized('id', state)
+        event.notifyDeserialized('__name__', state)