[Zope-CVS] CVS: Products/Ape/lib/apelib/sql - structure.py:1.8

Shane Hathaway shane at zope.com
Thu Feb 19 01:44:35 EST 2004


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

Modified Files:
	structure.py 
Log Message:
Two changes that make storing the Zope root object reasonable:

  - Pickled remainders are now encoded in base64 and stored in the
    properties file.  Ape no longer creates .remainder files, although
    it will read them.  This reduces the number of files Ape creates
    and sets a precedent that any annotation can contain a pickle
    as long as it's encoded as text.

  - There is now one PersistentMappingSerializer.  It stores both
    references and simple objects.  To accomplish this, it has to
    store reference values differently from non-reference values.
    The non-references get pickled and stored in an annotation called 
    "other". 

In testing, Ape successfully acted as the main Zope 
database.  Woohoo!  (A little Zope hack was required, but it 
should be possible to fix that.)



=== Products/Ape/lib/apelib/sql/structure.py 1.7 => 1.8 ===
--- Products/Ape/lib/apelib/sql/structure.py:1.7	Tue Feb 17 00:25:12 2004
+++ Products/Ape/lib/apelib/sql/structure.py	Thu Feb 19 01:44:04 2004
@@ -189,3 +189,13 @@
             # insert.
             self.execute(event, 'insert', **kw)
         return state
+
+
+def root_mapping():
+    """Returns a gateway suitable for storing the root persistent mapping.
+    """
+    from apelib.core.gateways import CompositeGateway
+    g = CompositeGateway()
+    g.add('references', SQLFolderItems())
+    g.add('others', SQLObjectData())
+    return g




More information about the Zope-CVS mailing list