Commit d99693e6 authored by Nicolas Delaby's avatar Nicolas Delaby

FormulatorPatch has been merged with Formulator

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26873 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8b8f9f00
...@@ -31,7 +31,6 @@ from Products.Formulator.Field import ZMIField ...@@ -31,7 +31,6 @@ from Products.Formulator.Field import ZMIField
from Products.Formulator import StandardFields from Products.Formulator import StandardFields
from Products.Formulator.DummyField import fields from Products.Formulator.DummyField import fields
from Products.PythonScripts.Utility import allow_class from Products.PythonScripts.Utility import allow_class
from Products.ERP5Form import FormulatorPatch
from zLOG import LOG from zLOG import LOG
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
...@@ -41,7 +40,7 @@ MINUTE_IN_SECOND = 60 ...@@ -41,7 +40,7 @@ MINUTE_IN_SECOND = 60
HOUR_IN_SECOND = 3600 HOUR_IN_SECOND = 3600
# DAY_IN_SECOND = 86400 # DAY_IN_SECOND = 86400
class DurationWidget(FormulatorPatch.IntegerWidget): class DurationWidget(Widget.IntegerWidget):
""" """
Duration Widget is used to enter time duration. Duration Widget is used to enter time duration.
It may be used in movement of Labour (in Task, Calendat Period, ...). It may be used in movement of Labour (in Task, Calendat Period, ...).
...@@ -101,19 +100,14 @@ class DurationWidget(FormulatorPatch.IntegerWidget): ...@@ -101,19 +100,14 @@ class DurationWidget(FormulatorPatch.IntegerWidget):
""" """
Render dynamically a subfield Render dynamically a subfield
""" """
return FormulatorPatch.IntegerFieldWidgetInstance.render_view(field, value, return self.render_view(field, value, REQUEST=REQUEST)
REQUEST=REQUEST)
def render_sub_field(self, field, key, value, REQUEST, keyword, render_prefix=None): def render_sub_field(self, field, key, value, REQUEST, keyword, render_prefix=None):
""" """
Render dynamically a subfield Render dynamically a subfield
""" """
return FormulatorPatch.IntegerFieldWidgetInstance.render( return Widget.IntegerWidget.render(self, field, field.generate_subfield_key(keyword, key=key),
field, value, REQUEST)
field.generate_subfield_key(keyword,
key=key),
value,
REQUEST)
class DurationValidator(Validator.IntegerValidator): class DurationValidator(Validator.IntegerValidator):
""" """
......
This diff is collapsed.
...@@ -80,7 +80,7 @@ class TestRenderViewAPI(unittest.TestCase): ...@@ -80,7 +80,7 @@ class TestRenderViewAPI(unittest.TestCase):
field.render_view.im_func.func_code.co_varnames) field.render_view.im_func.func_code.co_varnames)
if field is not ProxyField.ProxyField: if field is not ProxyField.ProxyField:
self.assertEquals(('self', 'field', 'value', 'REQUEST'), self.assertEquals(('self', 'field', 'value', 'REQUEST'),
field.widget.render_view.im_func.func_code.co_varnames[:4]) field.widget.render_view.im_func.func_code.co_varnames[:4], '%s %s' % (field.widget, field.widget.render_view.im_func.func_code.co_varnames[:4]))
class TestFloatField(unittest.TestCase): class TestFloatField(unittest.TestCase):
......
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