EntityFormRenderer redefine open_form and add a div section, so redefine close_form to add the closing div tag stable
authorStephanie Marcu <stephanie.marcu@logilab.fr>
Wed, 23 Jun 2010 12:33:25 +0200
branchstable
changeset 5828 c29c90223125
parent 5827 aad4496a279a
child 5829 f898991c6de5
EntityFormRenderer redefine open_form and add a div section, so redefine close_form to add the closing div tag
web/views/formrenderers.py
--- a/web/views/formrenderers.py	Wed Jun 23 09:30:59 2010 +0000
+++ b/web/views/formrenderers.py	Wed Jun 23 12:33:25 2010 +0200
@@ -409,6 +409,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%%">