strip string by default
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 21 Dec 2009 20:26:52 +0100
changeset 4169 341d19ef7b7c
parent 4168 9d83f9c80c1c
child 4170 c325c62cec8e
strip string by default
web/formwidgets.py
--- a/web/formwidgets.py	Mon Dec 21 20:26:30 2009 +0100
+++ b/web/formwidgets.py	Mon Dec 21 20:26:52 2009 +0100
@@ -65,6 +65,8 @@
     def process_field_data(self, form, field):
         posted = form._cw.form
         val = posted.get(field.input_name(form))
+        if isinstance(val, basestring):
+            val = val.strip() or None
         return val
 
     @deprecated('[3.6] use values_and_attributes')