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

Shane Hathaway shane@zope.com
Wed, 11 Jun 2003 09:58:54 -0400


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

Modified Files:
	ofsserial.py 
Log Message:
Ape was not restoring boolean properties correctly.  Good catch by Stefan Planert.

=== Products/Ape/lib/apelib/zope2/ofsserial.py 1.1 => 1.2 ===
--- Products/Ape/lib/apelib/zope2/ofsserial.py:1.1	Wed Apr  9 23:09:58 2003
+++ Products/Ape/lib/apelib/zope2/ofsserial.py	Wed Jun 11 09:58:53 2003
@@ -36,7 +36,6 @@
     'float': 1,
     'int': 1,
     'long': 1,
-    'string': 1,
     'date': 1,
     'date_international': 1,
     'text': 1,
@@ -284,6 +283,11 @@
         for id, t, v in state:
             if t == 'lines':
                 data = v.split('\n')
+            elif t == 'boolean':
+                if v == '0' or v[:1].lower() in 'fn': # match 0, [f]alse, [n]o
+                    data = 0
+                else:
+                    data = 1
             elif string_repr_types.get(t):
                 data = str(v)
             elif v: