[Zope] PATCH (was Formulator acts funny for 2-character options)

Jean Jordaan jean at upfrontsystems.co.za
Mon Aug 18 19:46:30 EDT 2003


Hi there

This fixes it :)

I'm sure it could be more elegant, but you get the idea ..

--- /usr/local/zope/Products/Formulator-1.4.1/Widget.py	2003-07-04 
12:47:48.000000000 +0200
+++ Formulator/Widget.py	2003-08-18 18:42:12.000000000 +0200
@@ -391,12 +391,17 @@
          # first one only (for now, may be able to fix this better later)
          selected_found = 0
          rendered_items = []
+        from types import StringType
          for item in items:
-            try:
-                item_text, item_value = item
-            except ValueError:
+            if isinstance(item, StringType):
                  item_text = item
                  item_value = item
+            else:
+                try:
+                    item_text, item_value = item
+                except ValueError:
+                    item_text = item
+                    item_value = item


              if item_value == value and not selected_found:

-- 
Jean Jordaan
http://www.upfrontsystems.co.za




More information about the Zope mailing list