[Checkins] SVN: megrok.z3cform/branches/megrok.z3cfrom-layout/src/megrok/z3cform/components.py Add the _finishedAdd to the PageAddForm class

Christian Klinger cklinger at novareto.de
Wed Jun 17 08:21:45 EDT 2009


Log message for revision 101105:
  Add the _finishedAdd to the PageAddForm class

Changed:
  U   megrok.z3cform/branches/megrok.z3cfrom-layout/src/megrok/z3cform/components.py

-=-
Modified: megrok.z3cform/branches/megrok.z3cfrom-layout/src/megrok/z3cform/components.py
===================================================================
--- megrok.z3cform/branches/megrok.z3cfrom-layout/src/megrok/z3cform/components.py	2009-06-17 11:22:42 UTC (rev 101104)
+++ megrok.z3cform/branches/megrok.z3cfrom-layout/src/megrok/z3cform/components.py	2009-06-17 12:21:45 UTC (rev 101105)
@@ -151,7 +151,17 @@
 
     martian.baseclass()
 
+    def _render_template(self):
+        assert not (self.template is None)
+        if self._finishedAdd:
+            self.request.response.redirect(self.nextURL())
+            return ""
+        if IGrokTemplate.providedBy(self.template):
+            return super(GrokForm, self)._render_template()
+        return self.template(self) 
 
+
+
 class PageEditForm(PageGrokForm, form.EditForm, megrok.layout.Page):
     """z3c edit form with megrok.layout support.
     """



More information about the Checkins mailing list