[Zope-CVS] CVS: Products/AdaptableStorage/serial - FieldSchema.py:1.2

Shane Hathaway shane@zope.com
Mon, 9 Dec 2002 15:27:39 -0500


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

Modified Files:
	FieldSchema.py 
Log Message:
Added two mappers to Zope2FS for serializing any kind of object.  If no mapper
is provided for a class, the database falls back to a default mapper--either
the "fileish" or the "folderish" mapper.

... which is *really cool*. :-)  I've been trying to achieve this in a clean
way for months.  (Deeeeep, loooonnnnnggggg sigh of relief!)



=== Products/AdaptableStorage/serial/FieldSchema.py 1.1 => 1.2 ===
--- Products/AdaptableStorage/serial/FieldSchema.py:1.1	Mon Dec  9 13:25:27 2002
+++ Products/AdaptableStorage/serial/FieldSchema.py	Mon Dec  9 15:27:08 2002
@@ -41,6 +41,10 @@
                 return 1  # Same
         return 0  # Different
 
+    def __repr__(self):
+        return 'FieldSchema(name=%s, type=%s, unique=%s)' % (
+            repr(self.name), repr(self.type), repr(self.unique))
+
 
 class RowSchema:
     """Defines an ordered set of fields for exactly one row.
@@ -68,6 +72,9 @@
                 return 1  # Same
         return 0  # Different
 
+    def __repr__(self):
+        return 'RowSchema(%s)' % repr(self.fields)
+
 
 class RowSequenceSchema (RowSchema):
     """Defines a schema for a sequence of rows, including row count limits.
@@ -88,4 +95,8 @@
                 self.max_rows == other.max_rows):
                 return 1  # Same
         return 0  # Different
+
+    def __repr__(self):
+        return 'RowSequenceSchema(%s, min_rows=%s, max_rows=%s)' % (
+            repr(self.fields), repr(self.min_rows), repr(self.max_rows))