[Zope3-checkins] CVS: Zope3/src/zope/app/browser/component -
interfacewidget.py:1.45.4.1
Garrett Smith
garrett at mojave-corp.com
Sun Feb 8 23:29:35 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/browser/component
In directory cvs.zope.org:/tmp/cvs-serv10762/src/zope/app/browser/component
Modified Files:
Tag: ozzope-widgets-branch
interfacewidget.py
Log Message:
Created a utility method _renderedValueSet that clarifies the use of
_data_marker.
=== Zope3/src/zope/app/browser/component/interfacewidget.py 1.45 => 1.45.4.1 ===
--- Zope3/src/zope/app/browser/component/interfacewidget.py:1.45 Tue Jan 20 15:16:13 2004
+++ Zope3/src/zope/app/browser/component/interfacewidget.py Sun Feb 8 23:29:04 2004
@@ -73,7 +73,7 @@
selected = field.default
else:
selected = marker
- if self._data is self._data_marker:
+ if not self._renderedValueSet():
value = self.request.form.get(self.name, marker) or marker
if value is not marker:
try:
@@ -160,9 +160,9 @@
base = None
first_is_blank = False
- if self._data is self._data_marker: # no data has been set with
- # Widget.setRenderedValue(),
- # so use the data in the form
+ if not self._renderedValueSet(): # no data has been set with
+ # Widget.setRenderedValue(),
+ # so use the data in the form
# If a search term is entered, that interface selection remains.
# If an interface is selected, that interface selection remains.
@@ -246,7 +246,7 @@
def hidden(self):
'See IBrowserWidget'
field = self.context
- if self._data is self._data_marker:
+ if not self._renderedValueSet():
try:
data = self.getInputValue()
except WidgetInputError:
@@ -278,7 +278,7 @@
class InterfaceDisplayWidget(InterfaceWidget):
def __call__(self):
field = self.context
- if self._data is self._data_marker:
+ if not self._renderedValueSet():
try:
data = self.getInputValue()
except WidgetInputError:
@@ -290,7 +290,7 @@
class MultiInterfaceDisplayWidget(MultiInterfaceWidget):
def __call__(self):
field = self.context
- if self._data is self._data_marker:
+ if self._renderedValueSet():
data = self._showData()
else:
data = self._data
More information about the Zope3-Checkins
mailing list