[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form -
widget.py:1.64.4.1
Garrett Smith
garrett at mojave-corp.com
Sat Feb 7 21:12:23 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv3100/src/zope/app/browser/form
Modified Files:
Tag: ozzope-widgets-branch
widget.py
Log Message:
Created branch for widget work at ozzope sprint.
=== Zope3/src/zope/app/browser/form/widget.py 1.64 => 1.64.4.1 ===
--- Zope3/src/zope/app/browser/form/widget.py:1.64 Wed Feb 4 14:17:29 2004
+++ Zope3/src/zope/app/browser/form/widget.py Sat Feb 7 21:11:52 2004
@@ -50,6 +50,8 @@
labels, titles, and descriptions are translated and the
errors are rendered with the view machinery, so we need to set up
a lot of machinery to support translation and views:
+
+ XXX OZ - move the more complex testing into a test module
>>> setUp() # now we have to set up an error view...
>>> from zope.app.interfaces.form import IWidgetInputError
@@ -138,7 +140,6 @@
Now we clean up.
>>> tearDown()
-
"""
implements(IBrowserWidget)
@@ -153,16 +154,6 @@
_missing = ''
_error = None
- def haveData(self):
- if traceback.extract_stack()[-2][2] != 'hasInput':
- warn("haveData is deprecated - use hasInput",
- DeprecationWarning, 2)
-
- # XXX - move this implementation to hasInput when deprecation is
- # removed
-
- return self.name in self.request.form
-
def hasInput(self):
"""See IWidget.hasInput.
@@ -174,7 +165,7 @@
forms when their value is 'off' -- in this case the widget will
need to add a hidden element to signal its presence in the form.
"""
- return self.haveData()
+ return self.name in self.request.form
def hasValidInput(self):
try:
@@ -183,14 +174,7 @@
except WidgetInputError:
return False
- def getData(self):
- if traceback.extract_stack()[-2][2] != 'getInputValue':
- warn("getData is deprecated - use getInputValue",
- DeprecationWarning, 2)
-
- # XXX - move this implementation to getInputValue when deprecation
- # is removed
-
+ def getInputValue(self):
self._error = None
field = self.context
@@ -215,9 +199,6 @@
raise self._error
return value
- def getInputValue(self):
- return self.getData()
-
def validate(self):
self.getInputValue()
@@ -921,7 +902,7 @@
class RadioWidget(SingleItemsWidget):
"""Radio buttons widget."""
- propertyNames = SingleItemsWidget.propertyNames +\
+ propertyNames = SingleItemsWidget.propertyNames + \
['firstItem', 'orientation']
orientation = "vertical"
More information about the Zope3-Checkins
mailing list