Commit 618cb1d1 authored by Romain Courteaud's avatar Romain Courteaud

Support default value.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12979 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 03375866
...@@ -55,7 +55,10 @@ class DurationWidget(FormulatorPatch.FloatWidget): ...@@ -55,7 +55,10 @@ class DurationWidget(FormulatorPatch.FloatWidget):
sub_field_render_list = [] sub_field_render_list = []
for title, sub_key, convertion in (('Hour', 'hour', HOUR_IN_SECOND), for title, sub_key, convertion in (('Hour', 'hour', HOUR_IN_SECOND),
('Minute', 'minute', MINUTE_IN_SECOND)): ('Minute', 'minute', MINUTE_IN_SECOND)):
sub_value, value = divmod(value, convertion) if value == '':
sub_value = ''
else:
sub_value, value = divmod(value, convertion)
sub_field_render_list.append((title, self.render_sub_field( sub_field_render_list.append((title, self.render_sub_field(
field, key, field, key,
sub_value, REQUEST, sub_key))) sub_value, REQUEST, sub_key)))
......
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