[CMF-checkins] CVS: CMF/CMFSetup - utils.py:1.15

Yvo Schubbe y.2005- at wcm-solutions.de
Sun Jan 23 09:51:07 EST 2005


Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv26512/CMFSetup

Modified Files:
	utils.py 
Log Message:
- fixed wrong default for False values


=== CMF/CMFSetup/utils.py 1.14 => 1.15 ===
--- CMF/CMFSetup/utils.py:1.14	Tue Dec 14 14:35:48 2004
+++ CMF/CMFSetup/utils.py	Sun Jan 23 09:51:07 2005
@@ -327,7 +327,13 @@
 
         prop_id = prop_map['id']
         prop = obj.getProperty(prop_id)
-        isTuple = isinstance(prop, tuple)
+
+        if isinstance(prop, tuple):
+            prop_value = ''
+            prop_elements = prop
+        else:
+            prop_value = prop
+            prop_elements = ()
 
         if 'd' in prop_map.get('mode', 'wd') and not prop_id == 'title':
             type = prop_map.get('type', 'string')
@@ -337,8 +343,8 @@
             select_variable = None
 
         return { 'id': prop_id,
-                 'value': not isTuple and prop or '',
-                 'elements': isTuple and prop or (),
+                 'value': prop_value,
+                 'elements': prop_elements,
                  'type': type,
                  'select_variable': select_variable }
 



More information about the CMF-checkins mailing list