[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - add.py:1.37.10.2 editview.py:1.46.4.1 editwizard.py:1.19.4.1 widget.py:1.64.4.8

Garrett Smith garrett at mojave-corp.com
Mon Feb 16 12:40:55 EST 2004


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

Modified Files:
      Tag: ozzope-widgets-branch
	add.py editview.py editwizard.py widget.py 
Log Message:

Continued refactoring of widgets machinery - still work in progress.


=== Zope3/src/zope/app/browser/form/add.py 1.37.10.1 => 1.37.10.2 ===
--- Zope3/src/zope/app/browser/form/add.py:1.37.10.1	Sun Feb  8 23:31:43 2004
+++ Zope3/src/zope/app/browser/form/add.py	Mon Feb 16 12:40:24 2004
@@ -56,10 +56,7 @@
 
             self.update_status = ''
             try:
-                data = getWidgetsData(self, self.schema,
-                                      strict=True,
-                                      names=self.fieldNames,
-                                      set_missing=False)
+                data = getWidgetsData(self, self.schema, names=self.fieldNames)
                 self.createAndAdd(data)
             except WidgetsError, errors:
                 self.errors = errors


=== Zope3/src/zope/app/browser/form/editview.py 1.46 => 1.46.4.1 ===
--- Zope3/src/zope/app/browser/form/editview.py:1.46	Thu Feb  5 17:52:19 2004
+++ Zope3/src/zope/app/browser/form/editview.py	Mon Feb 16 12:40:24 2004
@@ -61,7 +61,7 @@
             adapted.__parent__ = self.context
         self.adapted = adapted
         setUpEditWidgets(self, self.schema, names=self.fieldNames,
-                         content=self.adapted)
+                         context=self.adapted)
 
     def setPrefix(self, prefix):
         for widget in self.widgets():
@@ -89,8 +89,8 @@
         if Update in self.request:
             changed = False
             try:
-                changed = applyWidgetsChanges(self, content, self.schema,
-                    names=self.fieldNames, exclude_readonly=True)
+                changed = applyWidgetsChanges(self, self.schema,
+                    names=self.fieldNames, context=content)
                 # We should not generate events when an adapter is used.
                 # That's the adapter's job.
                 if changed and self.context is self.adapted:
@@ -99,8 +99,8 @@
                 self.errors = errors
                 status = _("An error occured.")
             else:
-                setUpEditWidgets(self, self.schema, force=1,
-                                 names=self.fieldNames, content=self.adapted)
+                setUpEditWidgets(self, self.schema, ignoreStickyValue=True,
+                                 names=self.fieldNames, context=self.adapted)
                 if changed:
                     self.changed()
                     formatter = self.request.locale.dates.getFormatter(


=== Zope3/src/zope/app/browser/form/editwizard.py 1.19 => 1.19.4.1 ===
--- Zope3/src/zope/app/browser/form/editwizard.py:1.19	Fri Feb  6 01:24:44 2004
+++ Zope3/src/zope/app/browser/form/editwizard.py	Mon Feb 16 12:40:24 2004
@@ -115,10 +115,7 @@
         # Validate the current pane, and set self.errors
         try:
             names = self.currentPane().names
-            data = getWidgetsData(
-                self, self.schema, strict=True, set_missing=True,
-                names=names, exclude_readonly=True
-                )
+            data = getWidgetsData(self, self.schema, names=names)
             self.errors = {}
         except WidgetsError, errors:
             x = {}
@@ -140,10 +137,7 @@
                     # Data from panes other than the current one is still
                     # stuck in request
                     self.storage.update(getWidgetsData(
-                            self, self.schema, strict=True, set_missing=True,
-                            names=self.fieldNames, exclude_readonly=True
-                            ))
-
+                        self, self.schema, names=self.fieldNames))
                 if self.apply_update(self.storage):
                     self.feedback = _(u'No changes to save')
                 else:
@@ -177,10 +171,8 @@
         for k,v in storage.items():
             getattr(self,k).setRenderedValue(v)
         content = self.adapted
-        changed = applyWidgetsChanges(
-                self, content, self.schema,
-                names=self.fieldNames, exclude_readonly=True
-                )
+        changed = applyWidgetsChanges(self, self.schema,
+                names=self.fieldNames, context=content)
         # We should not generate events when an adapter is used.
         # That's the adapter's job
         if changed and self.context is self.adapted:


=== Zope3/src/zope/app/browser/form/widget.py 1.64.4.7 => 1.64.4.8 ===
--- Zope3/src/zope/app/browser/form/widget.py:1.64.4.7	Sun Feb  8 23:29:04 2004
+++ Zope3/src/zope/app/browser/form/widget.py	Mon Feb 16 12:40:24 2004
@@ -1255,8 +1255,8 @@
 
     def _setUpEditWidgets(self):
         # subwidgets need a new name
-        setUpEditWidgets(self, self.context.schema, content=None,
-            prefix=self.name, names=self.names, context=self.context)
+        setUpEditWidgets(self, self.context.schema, prefix=self.name, 
+                         names=self.names, context=self.context)
 
     def __call__(self):
         """Render the widget
@@ -1312,8 +1312,8 @@
 
         # apply sub changes, see if there *are* any changes
         # XXX ObjectModifiedEvent here would be nice
-        changes = applyWidgetsChanges(self, value, field.schema,
-            names=self.names, exclude_readonly=True)
+        changes = applyWidgetsChanges(self, field.schema,
+            names=self.names, context=value)
 
         # if there's changes, then store the new value on the content
         if changes:




More information about the Zope3-Checkins mailing list