[Zope3-checkins] CVS: Zope3/src/zope/app/browser/component - configure.zcml:1.9.32.1 interfacewidget.py:1.45.14.1

Garrett Smith garrett at mojave-corp.com
Thu Feb 26 00:11:18 EST 2004


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

Modified Files:
      Tag: garrett-widgets2-branch
	configure.zcml interfacewidget.py 
Log Message:
Yet another branch for widgets refactoring (YABFWR).


=== Zope3/src/zope/app/browser/component/configure.zcml 1.9 => 1.9.32.1 ===
--- Zope3/src/zope/app/browser/component/configure.zcml:1.9	Mon Aug 25 15:28:31 2003
+++ Zope3/src/zope/app/browser/component/configure.zcml	Thu Feb 26 00:10:47 2004
@@ -1,29 +1,35 @@
-<zope:configure 
-   xmlns:zope="http://namespaces.zope.org/zope"
-   xmlns="http://namespaces.zope.org/browser">
+<configure xmlns="http://namespaces.zope.org/zope">
 
-  <page 
-      class=".interfacewidget.InterfaceWidget"
+  <view
+      type="zope.publisher.interfaces.browser.IBrowserRequest"
       for="zope.app.interfaces.component.IInterfaceField"
-      name="edit"
-      permission="zope.Public" />
+      provides="zope.app.interfaces.form.IEditWidget"
+      factory=".interfacewidget.InterfaceWidget"
+      permission="zope.Public"
+      />
 
-  <page 
-      class=".interfacewidget.InterfaceDisplayWidget"
+  <view
+      type="zope.publisher.interfaces.browser.IBrowserRequest"
       for="zope.app.interfaces.component.IInterfaceField"
-      name="display"
-      permission="zope.Public" />
+      provides="zope.app.interfaces.form.IDisplayWidget"
+      factory=".interfacewidget.InterfaceDisplayWidget"
+      permission="zope.Public"
+      />
 
-  <page 
-      class=".interfacewidget.MultiInterfaceWidget"
+  <view
+      type="zope.publisher.interfaces.browser.IBrowserRequest"
       for="zope.app.interfaces.component.IInterfacesField"
-      name="edit"
-      permission="zope.Public" />
+      provides="zope.app.interfaces.form.IEditWidget"
+      factory=".interfacewidget.MultiInterfaceWidget"
+      permission="zope.Public"
+      />
 
-  <page 
-      class=".interfacewidget.MultiInterfaceDisplayWidget"
+  <view
+      type="zope.publisher.interfaces.browser.IBrowserRequest"
       for="zope.app.interfaces.component.IInterfacesField"
-      name="display"
-      permission="zope.Public" />
+      provides="zope.app.interfaces.form.IDisplayWidget"
+      factory=".interfacewidget.MultiInterfaceDisplayWidget"
+      permission="zope.Public"
+      />
 
-</zope:configure>
+</configure>


=== Zope3/src/zope/app/browser/component/interfacewidget.py 1.45 => 1.45.14.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	Thu Feb 26 00:10:47 2004
@@ -18,9 +18,10 @@
 from zope.interface import Interface, implements
 from zope.app.browser.form.widget import BrowserWidget
 from zope.app.i18n import ZopeMessageIDFactory as _
-from zope.app.interfaces.browser.form import IBrowserWidget
-from zope.app.interfaces.form \
-     import WidgetInputError, ConversionError, MissingInputError
+from zope.app.interfaces.form import IEditWidget
+from zope.app.interfaces.form import WidgetInputError
+from zope.app.interfaces.form import ConversionError
+from zope.app.interfaces.form import MissingInputError
 from zope.app.introspector import nameToInterface, interfaceToName
 from zope.app.services.servicenames import Interfaces
 from zope.component import getService
@@ -30,7 +31,7 @@
 
 class InterfaceWidget(BrowserWidget, BrowserView):
 
-    implements(IBrowserWidget)
+    implements(IEditWidget)
 
     def _convert(self, value):
         if value and value != 'None':
@@ -73,7 +74,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:
@@ -105,7 +106,7 @@
 # which is a tuple of interfaces.
 class MultiInterfaceWidget(BrowserWidget, BrowserView):
 
-    implements(IBrowserWidget)
+    implements(IEditWidget)
 
     # Names used:
     #
@@ -264,16 +265,6 @@
             count += 1
         return ''.join(elements)
 
-    # --- deprecated methods of IBrowserWidget
-
-    def renderHidden(self, value):
-        'See IBrowserWidget'
-        raise NotImplementedError
-
-    def render(self, value):
-        'See IBrowserWidget'
-        raise NotImplementedError
-
 
 class InterfaceDisplayWidget(InterfaceWidget):
     def __call__(self):
@@ -286,6 +277,7 @@
         else:
             data = self._data
         return interfaceToName(field.context, data)
+        
 
 class MultiInterfaceDisplayWidget(MultiInterfaceWidget):
     def __call__(self):
@@ -296,6 +288,7 @@
             data = self._data
         return ', '.join([interfaceToName(field.context, interface)
                           for interface in data])
+                          
 
 def renderInterfaceSelect(
         interfaces, selected, search_name, search_string, select_name):




More information about the Zope3-Checkins mailing list