[Zope3-checkins] SVN: zope.formlib/trunk/src/zope/formlib/ Some small changes to formlib:

Gary Poster gary at zope.com
Fri Aug 19 13:50:29 EDT 2005


Log message for revision 38007:
  Some small changes to formlib:
  
  - __finished_add = _finished_add, to make subclassing easier
  - make the pageform template extend the current view (note that this spelling
    will have to change once Fred changes the macro spelling).
  
  

Changed:
  U   zope.formlib/trunk/src/zope/formlib/form.py
  U   zope.formlib/trunk/src/zope/formlib/pageform.pt

-=-
Modified: zope.formlib/trunk/src/zope/formlib/form.py
===================================================================
--- zope.formlib/trunk/src/zope/formlib/form.py	2005-08-19 15:06:40 UTC (rev 38006)
+++ zope.formlib/trunk/src/zope/formlib/form.py	2005-08-19 17:50:28 UTC (rev 38007)
@@ -837,15 +837,15 @@
         raise NotImplementedError(
             "concrete classes must implement create() or createAndAdd()")
 
-    __finished_add = False
+    _finished_add = False
 
     def add(self, object):
         ob = self.context.add(object)
-        self.__finished_add = True
+        self._finished_add = True
         return ob
 
     def render(self):
-        if self.__finished_add:
+        if self._finished_add:
             self.request.response.redirect(self.nextURL())
             return ""
         return super(AddFormBase, self).render()

Modified: zope.formlib/trunk/src/zope/formlib/pageform.pt
===================================================================
--- zope.formlib/trunk/src/zope/formlib/pageform.pt	2005-08-19 15:06:40 UTC (rev 38006)
+++ zope.formlib/trunk/src/zope/formlib/pageform.pt	2005-08-19 17:50:28 UTC (rev 38007)
@@ -1,4 +1,5 @@
-<html metal:use-macro="context/@@standard_macros/view">
+<html metal:use-macro="context/@@standard_macros/view"
+      metal:define-macro="main">
 <head>
 <!-- XXX Need test -->
 </head>



More information about the Zope3-Checkins mailing list