by default this is not the widget responsability to turn empty string into None,
move this behaviour to the field.
--- a/web/formfields.py Wed Jan 27 09:57:53 2010 +0100
+++ b/web/formfields.py Wed Jan 27 09:59:13 2010 +0100
@@ -359,7 +359,7 @@
correctly typed objects, but process_for_value must return a typed value.
Override this method to type the value if necessary
"""
- return value
+ return value or None
def process_posted(self, form):
for field in self.actual_fields(form):
--- a/web/formwidgets.py Wed Jan 27 09:57:53 2010 +0100
+++ b/web/formwidgets.py Wed Jan 27 09:59:13 2010 +0100
@@ -115,7 +115,7 @@
posted = form._cw.form
val = posted.get(field.input_name(form, self.suffix))
if isinstance(val, basestring):
- val = val.strip() or None
+ val = val.strip()
return val
@deprecated('[3.6] use values_and_attributes')