[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - editwizard.py:1.19

Stuart Bishop zen at shangri-la.dropbear.id.au
Fri Feb 6 01:24:45 EST 2004


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

Modified Files:
	editwizard.py 
Log Message:
Add and Edit wizards working again. Still needs unit tests.
See doc/zcml/namespaces.zope.org/browser/*wizard.stx if your
schema generated forms are getting too big.


=== Zope3/src/zope/app/browser/form/editwizard.py 1.18 => 1.19 ===
--- Zope3/src/zope/app/browser/form/editwizard.py:1.18	Fri Nov 21 12:10:10 2003
+++ Zope3/src/zope/app/browser/form/editwizard.py	Fri Feb  6 01:24:44 2004
@@ -114,22 +114,19 @@
 
         # Validate the current pane, and set self.errors
         try:
-            if self.use_session:
-                names = self.currentPane().names
-            else:
-                names = self.fieldNames
+            names = self.currentPane().names
             data = getWidgetsData(
                 self, self.schema, strict=True, set_missing=True,
                 names=names, exclude_readonly=True
                 )
             self.errors = {}
         except WidgetsError, errors:
-            errors = {}
+            x = {}
             for k, label, msg in errors:
-                errors[k] = msg
-            self.errors = errors
-
+                x[k] = msg
+            self.errors = x
         else:
+
             self.storage.update(data)
 
             if Next in self.request:
@@ -139,6 +136,14 @@
                 self._current_pane_idx -= 1
                 assert self._current_pane_idx >= 0
             elif Update in self.request:
+                if not self.use_session:
+                    # 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
+                            ))
+
                 if self.apply_update(self.storage):
                     self.feedback = _(u'No changes to save')
                 else:
@@ -231,7 +236,7 @@
         NamesChecker(("__call__", "__getitem__", "browserDefault"), permission)
         )
 
-    s = zapi.getService(None, zapi.servicenames.Previous)
+    s = zapi.getService(None, zapi.servicenames.Presentation)
     s.provideView(for_, name, IBrowserRequest, class_, layer)
 
 




More information about the Zope3-Checkins mailing list