Commit bfac8526 authored by Romain Courteaud's avatar Romain Courteaud

DateTimeField can now have the empty string as default value.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12940 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3c67f380
...@@ -746,7 +746,10 @@ class PatchedDateTimeWidget(DateTimeWidget): ...@@ -746,7 +746,10 @@ class PatchedDateTimeWidget(DateTimeWidget):
if not hasattr(field, 'sub_form'): if not hasattr(field, 'sub_form'):
field.sub_form = create_datetime_text_sub_form() field.sub_form = create_datetime_text_sub_form()
if value is None and field.get_value('default_now'): # Is it still usefull to test the None value,
# as DateTimeField should be considerer as the other field
# and get an empty string as default value?
if value in (None, '') and field.get_value('default_now'):
value = DateTime() value = DateTime()
year = None year = None
month = None month = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment