[Zope3-checkins] CVS: Zope3/src/zope/app/browser/component - interfacewidget.py:1.24
Jim Fulton
jim@zope.com
Mon, 3 Feb 2003 14:00:23 -0500
Update of /cvs-repository/Zope3/src/zope/app/browser/component
In directory cvs.zope.org:/tmp/cvs-serv14778
Modified Files:
interfacewidget.py
Log Message:
Fixed bug:
Current interface values were not being shown as selected.
=== Zope3/src/zope/app/browser/component/interfacewidget.py 1.23 => 1.24 ===
--- Zope3/src/zope/app/browser/component/interfacewidget.py:1.23 Sat Jan 25 13:26:23 2003
+++ Zope3/src/zope/app/browser/component/interfacewidget.py Mon Feb 3 14:00:21 2003
@@ -69,8 +69,6 @@
search_name = name + ".search"
search_string = self.request.form.get(search_name, '')
- value = self.request.form.get(self.name, self) # self used as marker
-
field = self.context
service = getService(field.context, "Interfaces")
base = field.basetype
@@ -92,15 +90,16 @@
if include_none and not search_string:
interfaces = ['None'] + interfaces
+ marker = self
+ selected = marker
if self._data is None:
- selected = self.getData(1)
+ value = self.request.form.get(self.name, marker)
+ if value is not marker:
+ selected = self.getData(1)
else:
selected = self._data
- # if nothing selected in the form...
- if value is self:
- selected = None
- else:
+ if selected is not marker:
selected = interfaceToName(selected)
return renderInterfaceSelect(