[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Formulator/Widgets - IWidget.py:1.1.4.1.14.1 Widget.py:1.1.4.1.14.1

Jim Fulton jim@zope.com
Wed, 29 May 2002 11:10:06 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/Formulator/Widgets
In directory cvs.zope.org:/tmp/cvs-serv12181/lib/python/Zope/App/Formulator/Widgets

Modified Files:
      Tag: Zope3InWonderland-branch
	IWidget.py Widget.py 
Log Message:
- Added permission_id attribute to adapter and utility directives.

- Got rid of old getView, getResource, and getDefaultViewName.
  Renamed getRequestView to getView (and so on).

  Changed view interface to use context, rather than getContext.

  Introduced notion of presentation types (e.g. IBrowserPresentation, 
  which is cleaner than IBrowserPublisher).

- Began converting to get/queryFoo, which is much nicer.

- Many formatting fixups.



=== Zope3/lib/python/Zope/App/Formulator/Widgets/IWidget.py 1.1.4.1 => 1.1.4.1.14.1 ===
 """
 
-from Interface import Interface
+from Zope.ComponentArchitecture.IContextDependent import IContextDependent
 
-
-class IWidget(Interface):
+class IWidget(IContextDependent):
     """Generically describes the behavior of a widget.
 
     The widget defines a list of propertyNames, which describes
@@ -31,7 +30,3 @@
 
     def getValue(name):
         """Look up a Widget setting (value) by name."""
-
-
-    def getContext():
-        """Get the context of the widget, namely the Field."""


=== Zope3/lib/python/Zope/App/Formulator/Widgets/Widget.py 1.1.4.1 => 1.1.4.1.14.1 ===
 # 
 ##############################################################################
-"""
-
-$Id$
-"""
-from IWidget import IWidget
-
-
-class Widget:
-    """I do not know what will be in this class, but it provides
-    an extra layer.
-    """
-
-    __implements__ = IWidget
-
-    propertyNames = []
-
-
-    def __init__(self, field):
-        """ """
-        self._field = field
-
-
-    def getValue(self, name):
-        """ """
-        if name in self.propertyNames:
-            return getattr(self, name, None)
-
-
-    def getContext(self):
-        """ """
-        return self._field
+"""
+
+$Id$
+"""
+from IWidget import IWidget
+
+class Widget:
+    """I do not know what will be in this class, but it provides
+    an extra layer.
+    """
+
+    __implements__ = IWidget
+
+    propertyNames = []
+
+
+    def __init__(self, field):
+        """ """
+        self.context = field
+
+
+    def getValue(self, name):
+        """ """
+        if name in self.propertyNames:
+            return getattr(self, name, None)