[Zope3-checkins] CVS: Zope3/src/zope/app/browser/component - interfacewidget.py:1.27.8.1

Jim Fulton jim@zope.com
Tue, 18 Mar 2003 11:56:14 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/component
In directory cvs.zope.org:/tmp/cvs-serv21811/zope/app/browser/component

Modified Files:
      Tag: local-utility-branch
	interfacewidget.py 
Log Message:
checkpoint into branch

=== Zope3/src/zope/app/browser/component/interfacewidget.py 1.27 => 1.27.8.1 ===
--- Zope3/src/zope/app/browser/component/interfacewidget.py:1.27	Tue Feb 11 21:17:04 2003
+++ Zope3/src/zope/app/browser/component/interfacewidget.py	Tue Mar 18 11:55:43 2003
@@ -31,6 +31,8 @@
 class InterfaceWidget(Widget, BrowserView):
     __implements__ = IBrowserWidget
 
+    interfaces = None
+
     def haveData(self):
         if self.name in self.request.form:
             v = self.request.form[self.name]
@@ -72,12 +74,18 @@
 
         field = self.context
         service = getService(field.context, Interfaces)
+
+        interfaces = self.interfaces
         base = field.basetype
         include_none = base is None
-        if base == Interface:
-            base = None
 
-        interfaces = list(service.searchInterface(search_string, base=base))
+        if interfaces is None:
+
+            if base == Interface:
+                base = None
+
+            interfaces = list(service.searchInterface(search_string,
+                                                      base=base))
             
         if field.constraint is not None:
             interfaces = [i