[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/form/ Moved applyChanges from zope.app.form.browser.widget.SimpleInputWidget

Jim Fulton jim at zope.com
Fri Oct 1 14:36:04 EDT 2004


Log message for revision 27732:
  Moved applyChanges from zope.app.form.browser.widget.SimpleInputWidget
  to zope.app.form.InputWidget.
  
  This is code that is probably never overridden. It probably should
  be moved up out of the interface into zope.app.form.utility.  In any
  case, it's more likely to be inherited from zope.app.form.InputWidget, 
  as this class makes far fewer demands on subclasses than the other.
  


Changed:
  U   Zope3/trunk/src/zope/app/form/__init__.py
  U   Zope3/trunk/src/zope/app/form/browser/widget.py


-=-
Modified: Zope3/trunk/src/zope/app/form/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/form/__init__.py	2004-10-01 18:22:45 UTC (rev 27731)
+++ Zope3/trunk/src/zope/app/form/__init__.py	2004-10-01 18:36:04 UTC (rev 27732)
@@ -77,6 +77,15 @@
     def validate(self):
         self.getInputValue()
 
+    def applyChanges(self, content):
+        field = self.context
+        value = self.getInputValue()
+        if field.query(content, self) != value:
+            field.set(content, value)
+            return True
+        else:
+            return False
+
 class CustomWidgetFactory(object):
     """Custom Widget Factory."""
     implements(IViewFactory)

Modified: Zope3/trunk/src/zope/app/form/browser/widget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/widget.py	2004-10-01 18:22:45 UTC (rev 27731)
+++ Zope3/trunk/src/zope/app/form/browser/widget.py	2004-10-01 18:36:04 UTC (rev 27732)
@@ -311,15 +311,6 @@
             raise self._error
         return value
 
-    def applyChanges(self, content):
-        field = self.context
-        value = self.getInputValue()
-        if field.query(content, self) != value:
-            field.set(content, value)
-            return True
-        else:
-            return False
-
     def _getFormInput(self):
         """Returns current form input.
         



More information about the Zope3-Checkins mailing list