web/formfields.py
changeset 4110 8728d8c95985
parent 4101 7fa86fa51229
child 4156 1bbb0ee42c8e
--- a/web/formfields.py	Thu Dec 10 17:59:32 2009 +0100
+++ b/web/formfields.py	Thu Dec 10 18:00:15 2009 +0100
@@ -565,6 +565,15 @@
     def format_single_value(self, req, value):
         return value
 
+    def process_form_value(self, form):
+        """process posted form and return correctly typed value"""
+        widget = self.get_widget(form)
+        value = widget.process_field_data(form, self)
+        if value is None:
+            return ()
+        elif not isinstance(value, list):
+            return (value,)
+        return value
 
 class CompoundField(Field):
     def __init__(self, fields, *args, **kwargs):