Commit ce9415b9 authored by Rafael Monnerat's avatar Rafael Monnerat

No need to use lazyMethod (at least not for now).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43331 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c9c78dbe
...@@ -2,7 +2,6 @@ from Products.Formulator.Field import ZMIField ...@@ -2,7 +2,6 @@ from Products.Formulator.Field import ZMIField
from Products.Formulator import Widget from Products.Formulator import Widget
from Products.Formulator.DummyField import fields from Products.Formulator.DummyField import fields
from Products.Formulator import Validator from Products.Formulator import Validator
from Products.ERP5Form.ListBox import lazyMethod
class AudioWidget(Widget.TextWidget): class AudioWidget(Widget.TextWidget):
""" """
...@@ -111,22 +110,19 @@ class AudioWidget(Widget.TextWidget): ...@@ -111,22 +110,19 @@ class AudioWidget(Widget.TextWidget):
else: else:
return [] return []
def getContext(self): def getContext(self, field, REQUEST):
"""Return the context of rendering this Field.. """Return the context of rendering this Field.
""" """
value = self.request.get('here') value = REQUEST.get('here')
if value is None: if value is None:
value = self.getForm().aq_parent value = self.getForm(field).aq_parent
return value return value
getContext = lazyMethod(getContext)
def getForm(self): def getForm(self, field):
"""Return the form which contains the Field. """Return the form which contains the Field.
""" """
return self.field.aq_parent return field.aq_parent
getForm = lazyMethod(getForm)
AudioWidgetInstance = AudioWidget() AudioWidgetInstance = AudioWidget()
......
...@@ -2,7 +2,6 @@ from Products.Formulator.Field import ZMIField ...@@ -2,7 +2,6 @@ from Products.Formulator.Field import ZMIField
from Products.Formulator import Widget from Products.Formulator import Widget
from Products.Formulator.DummyField import fields from Products.Formulator.DummyField import fields
from Products.Formulator import Validator from Products.Formulator import Validator
from Products.ERP5Form.ListBox import lazyMethod
class VideoWidget(Widget.TextWidget): class VideoWidget(Widget.TextWidget):
""" """
...@@ -127,22 +126,20 @@ class VideoWidget(Widget.TextWidget): ...@@ -127,22 +126,20 @@ class VideoWidget(Widget.TextWidget):
else: else:
return [] return []
def getContext(self): def getContext(self, field, REQUEST):
"""Return the context of rendering this Field.. """Return the context of rendering this Field.
""" """
value = self.request.get('here') value = REQUEST.get('here')
if value is None: if value is None:
value = self.getForm().aq_parent value = self.getForm(field).aq_parent
return value return value
getContext = lazyMethod(getContext)
def getForm(self): def getForm(self, field):
"""Return the form which contains the Field. """Return the form which contains the Field.
""" """
return self.field.aq_parent return field.aq_parent
getForm = lazyMethod(getForm)
VideoWidgetInstance = VideoWidget() VideoWidgetInstance = VideoWidget()
......
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