[Zope3-checkins] CVS: Zope3/src/zope/app/dav - configure.zcml:1.10 widget.py:1.5

Garrett Smith garrett at mojave-corp.com
Wed Aug 13 18:29:06 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/dav
In directory cvs.zope.org:/tmp/cvs-serv9151/src/zope/app/dav

Modified Files:
	configure.zcml widget.py 
Log Message:
Made the following changes to the widget machinery:

- Renamed IWidget getData to getInputValue

getInputValue no longer accepts an 'optional' flag. If value is missing or is invalid, getInputValue will raise an error. Calls made to this method should be in a try...except block to handle such conditions.

- Renamed IWidget haveData to hasInput

- Added method hasValidInput to IWidget and widget implementations

- Renamed IWidget setData to setRenderedValue

- Added functional tests for some of the core widgets - additional ftests are needed

- Deleted the class PossibleEmptyMeansMissing - it's no longer needed

- Added deprecation tests for changes to widgets

- Some widgets were refactored to use the new framework correctly

These changes were based on the proposal:

 http://dev.zope.org/Zope3/ComponentArchitecture/WidgetsFormsSchemas

Not all the changes in the proposal are included in this commit. Specifically, getRawData/setRawData and the refactoring of the widget error classes are the two major changes not included in this commit.

=== Zope3/src/zope/app/dav/configure.zcml 1.9 => 1.10 ===
--- Zope3/src/zope/app/dav/configure.zcml:1.9	Sat Aug  2 13:26:12 2003
+++ Zope3/src/zope/app/dav/configure.zcml	Wed Aug 13 17:28:30 2003
@@ -52,7 +52,7 @@
       permission="zope.Public"
       type="zope.publisher.interfaces.http.IHTTPPresentation"
       factory="zope.app.dav.widget.TextDAVWidget"
-      allowed_attributes="getData haveData setData __call__ __str__" />
+      allowed_attributes="getData hasInput setRenderedValue __call__ __str__" />
   
   <defaultView
       for="zope.schema.interfaces.ITextLine"
@@ -60,7 +60,7 @@
       permission="zope.Public"
       type="zope.publisher.interfaces.http.IHTTPPresentation"
       factory="zope.app.dav.widget.TextDAVWidget"
-      allowed_attributes="getData haveData setData __call__ __str__" />
+      allowed_attributes="getData hasInput setRenderedValue __call__ __str__" />
   
   <defaultView
       for="zope.schema.interfaces.IDatetime"
@@ -68,7 +68,7 @@
       permission="zope.Public"
       type="zope.publisher.interfaces.http.IHTTPPresentation"
       factory="zope.app.dav.widget.TextDAVWidget"
-      allowed_attributes="getData haveData setData __call__ __str__" />
+      allowed_attributes="getData hasInput setRenderedValue __call__ __str__" />
   
   <defaultView
       for="zope.schema.interfaces.ISequence"
@@ -76,7 +76,7 @@
       permission="zope.Public"
       type="zope.publisher.interfaces.http.IHTTPPresentation"
       factory="zope.app.dav.widget.SequenceDAVWidget"
-      allowed_attributes="getData haveData setData __call__ __str__" />
+      allowed_attributes="getData hasInput setRenderedValue __call__ __str__" />
   
   <adapter
       provides="zope.app.interfaces.dav.IDAVSchema"


=== Zope3/src/zope/app/dav/widget.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/dav/widget.py:1.4	Fri Jun  6 15:29:01 2003
+++ Zope3/src/zope/app/dav/widget.py	Wed Aug 13 17:28:30 2003
@@ -25,17 +25,17 @@
 class SimpleDAVWidget(Widget):
     implements(ISimpleDAVWidget, IWidget, IViewFactory)
 
-    def haveData(self):
+    def hasInput(self):
         return 1
 
-    def getData(self):
+    def getInputValue(self):
         return self._data
 
     def __str__(self):
         return str(self._data)
 
     def __call__(self):
-        return self.getData()
+        return self.getInputValue()
 
 class TextDAVWidget(SimpleDAVWidget):
     pass




More information about the Zope3-Checkins mailing list