[Zope-CVS] CVS: Products/AdaptableStorage - Zope2Mapper.py:1.4

Shane Hathaway shane@zope.com
Mon, 6 Jan 2003 10:37:17 -0500


Update of /cvs-repository/Products/AdaptableStorage
In directory cvs.zope.org:/tmp/cvs-serv31552

Modified Files:
	Zope2Mapper.py 
Log Message:
Added OptionalAspect, a wrapper that disables an aspect if it can't
serialize the object.  This involved refactoring the IAspectSerializer
and IObjectSerializer interfaces.  Thanks, Christian, for discovering
the need for this.



=== Products/AdaptableStorage/Zope2Mapper.py 1.3 => 1.4 ===
--- Products/AdaptableStorage/Zope2Mapper.py:1.3	Fri Jan  3 17:04:14 2003
+++ Products/AdaptableStorage/Zope2Mapper.py	Mon Jan  6 10:36:45 2003
@@ -21,7 +21,7 @@
      import ObjectSerializer, ObjectGateway, ObjectMapper
 from mapper_std.public \
      import RollCall, FixedPersistentMapping, IgnoredAttribute, \
-     AnyObjectSerializer, StringDataAttribute
+     AnyObjectSerializer, StringDataAttribute, OptionalAspect
 from serial_ofs.public \
      import FolderItems, FolderItemsByKeychain, MetaTypeClassifier, \
      IdAttribute, FilePData, OFSProperties
@@ -98,7 +98,7 @@
     s = AnyObjectSerializer()
     m.setSerializer(s)
     s.addAspect('items', folder_items_aspect)
-    s.addAspect('properties', properties_aspect)
+    s.addAspect('properties', OptionalAspect(properties_aspect, []))
     s.addAspect('id', IdAttribute())
     s.addAspect('remainder', RemainingState())
     classifier.registerDefaultStorage('(folderish object)', 'anyfolder', 1)