web/views/formrenderers.py
changeset 5849 9db65b381028
parent 5774 0d792bceb25d
parent 5830 23ea56123670
child 5877 0c7b7b76a84f
--- a/web/views/formrenderers.py	Wed Jun 30 15:43:36 2010 +0200
+++ b/web/views/formrenderers.py	Thu Jul 01 17:06:37 2010 +0200
@@ -397,10 +397,6 @@
     _options = FormRenderer._options + ('main_form_title',)
     main_form_title = _('main informations')
 
-    def render(self, form, values):
-        rendered = super(EntityFormRenderer, self).render(form, values)
-        return rendered + u'</div>' # close extra div introducted by open_form
-
     def open_form(self, form, values):
         attrs_fs_label = ''
         if self.main_form_title:
@@ -409,6 +405,13 @@
         attrs_fs_label += '<div class="formBody">'
         return attrs_fs_label + super(EntityFormRenderer, self).open_form(form, values)
 
+    def close_form(self, form, values):
+        """seems dumb but important for consistency w/ close form, and necessary
+        for form renderers overriding open_form to use something else or more than
+        and <form>
+        """
+        return super(EntityFormRenderer, self).close_form(form, values) + '</div>'
+
     def render_buttons(self, w, form):
         if len(form.form_buttons) == 3:
             w("""<table width="100%%">