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

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


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

Modified Files:
      Tag: CMF-1_5-branch
	utils.py 
Log Message:
- fixed wrong default for False values


=== CMF/CMFSetup/utils.py 1.13.2.1 => 1.13.2.2 ===
--- CMF/CMFSetup/utils.py:1.13.2.1	Tue Dec 14 14:34:49 2004
+++ CMF/CMFSetup/utils.py	Sun Jan 23 09:50:39 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