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

Jim Fulton jim@zope.com
Fri, 7 Jun 2002 10:41:30 -0400


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

Modified Files:
      Tag: Zope-3x-branch
	IWidget.py Widget.py 
Log Message:
Merging in Zope3InWonderland-branch, which implemented the following
proposals (see
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/OldProposals): 
- RenameAllowToRequire

- GroupClassRelatedDirectivesInClassDirective

- ViewInterfaceAndSimplification

- ConsistentUseOfSpacesAsDelimitersInZCMLAttributes

- TwoArgumentViewConstructors

- ImplementsInZCML

- SimpleViewCreationInZCML

- RemoveGetView

- ReplaceProtectWithAllow

- ViewMethodsAsViews

- MergeProtectionAndComponentDefinitions

There were also various security fixes resulting of better integration
of security with components.


=== Zope3/lib/python/Zope/App/Formulator/Widgets/IWidget.py 1.1.4.1 => 1.1.4.2 ===
 """
 
-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.2 => 1.1.4.3 ===
 from IWidget import IWidget
 
-
 class Widget:
     """I do not know what will be in this class, but it provides
     an extra layer.
@@ -30,15 +29,10 @@
 
     def __init__(self, field):
         """ """
-        self._field = field
+        self.context = field
 
 
     def getValue(self, name):
         """ """
         if name in self.propertyNames:
             return getattr(self, name, None)
-
-
-    def getContext(self):
-        """ """
-        return self._field