[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/ Unbroke just enough of the wizards so that it is not completely broken. Widgets have a _widget prefix. 'usage' is gone. Default use_session to false as sessions don't exist yet.

Sidnei da Silva sidnei at awkly.org
Fri Jul 2 11:10:17 EDT 2004


Log message for revision 26043:
Unbroke just enough of the wizards so that it is not completely broken. Widgets have a _widget prefix. 'usage' is gone. Default use_session to false as sessions don't exist yet.


-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/editwizard.pt
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/editwizard.pt	2004-07-02 10:34:31 UTC (rev 26042)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/editwizard.pt	2004-07-02 15:10:17 UTC (rev 26043)
@@ -28,10 +28,6 @@
         
         <div metal:use-macro="context/@@form_macros/widget_rows" />
         
-        <div tal:replace="structure view/renderHidden">
-          <!-- type=hidden input controls for passing state without session -->
-          <input type="hidden" name="example" value="foo" />
-        </div>
         <div class="row"
              metal:define-slot="extra_bottom" tal:replace="nothing">
             <div class="label">Extra bottom</div>
@@ -56,6 +52,10 @@
         </div>
       </div>
 
+        <div tal:replace="structure view/renderHidden">
+          <!-- type=hidden input controls for passing state without session -->
+          <input type="hidden" name="example" value="foo" />
+        </div>
     </form>
 
   </div>

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/editwizard.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/editwizard.py	2004-07-02 10:34:31 UTC (rev 26042)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/editwizard.py	2004-07-02 15:10:17 UTC (rev 26043)
@@ -164,7 +164,7 @@
         try:
             for k in self.fieldNames:
                 if k not in self.currentPane().names:
-                    getattr(self, k).getInputValue()
+                    getattr(self, k+'_widget').getInputValue()
             self.show_submit = 1
         except WidgetInputError:
             self.show_submit = 0
@@ -176,7 +176,7 @@
     def apply_update(self, storage):
         ''' Save changes to our content object '''
         for k,v in storage.items():
-            getattr(self,k).setRenderedValue(v)
+            getattr(self,k+'_widget').setRenderedValue(v)
         content = self.adapted
         changed = applyWidgetsChanges(self, self.schema, target=content,
                 names=self.fieldNames)
@@ -210,14 +210,14 @@
             current_fields = self.currentPane().names
             for k in self.fieldNames:
                 if k not in current_fields:
-                    widget = getattr(self, k)
+                    widget = getattr(self, k+'_widget')
                     out(widget.hidden())
             return ''.join(olist)
 
 
 def EditWizardViewFactory(name, schema, permission, layer,
                     panes, fields, template, default_template, bases, for_,
-                    menu=u'', usage=u'', use_session=True):
+                    menu=u'', use_session=False):
     # XXX What about the __implements__ of the bases?
     class_ = SimpleViewClass(template, used_for=schema, bases=bases)
     class_.schema = schema
@@ -227,9 +227,6 @@
 
     class_.generated_form = ViewPageTemplateFile(default_template)
 
-    class_.usage = usage or (
-        menu and globalBrowserMenuService.getMenuUsage(menu))
-
     defineChecker(
         class_,
         NamesChecker(("__call__", "__getitem__", "browserDefault"), permission)

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/metaconfigure.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/metaconfigure.py	2004-07-02 10:34:31 UTC (rev 26042)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/metaconfigure.py	2004-07-02 15:10:17 UTC (rev 26043)
@@ -128,7 +128,7 @@
 
     # default wizard information
     description = None
-    use_sessions = True
+    use_session = False
 
     def __init__(self, _context, **kwargs):
         super(BaseWizardDirective, self).__init__(_context, **kwargs)
@@ -282,7 +282,6 @@
 
     view = AddWizardView
     default_template = 'addwizard.pt'
-    use_session = False
 
     def __call__(self):
         self._handle_menu()

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/metadirectives.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/metadirectives.py	2004-07-02 10:34:31 UTC (rev 26042)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/form/browser/metadirectives.py	2004-07-02 15:10:17 UTC (rev 26043)
@@ -152,7 +152,8 @@
         between panes in the wizard. Only simple data types can
         be propagated with this method.
 
-        Defaults to 'yes'.""",
+        Defaults to 'no'.""",
+        default=False,
         required=False
         )
 



More information about the Zope3-Checkins mailing list