_render_fields don't need values argument tls-sprint
authorsylvain.thenault@logilab.fr
Fri, 17 Apr 2009 18:51:01 +0200
branchtls-sprint
changeset 1403 425892e14e67
parent 1402 04b7afb14b50
child 1406 133476216f4a
_render_fields don't need values argument
web/formrenderers.py
web/views/massmailing.py
--- a/web/formrenderers.py	Fri Apr 17 18:45:06 2009 +0200
+++ b/web/formrenderers.py	Fri Apr 17 18:51:01 2009 +0200
@@ -152,7 +152,7 @@
         form.form_build_context(values)
         fields = self._render_hidden_fields(w, form)
         if fields:
-            self._render_fields(fields, w, form, values)
+            self._render_fields(fields, w, form)
         self.render_child_forms(w, form, values)
         
     def render_child_forms(self, w, form, values):
@@ -170,7 +170,7 @@
                 fields.remove(field)
         return fields
     
-    def _render_fields(self, fields, w, form, values):
+    def _render_fields(self, fields, w, form):
         w(u'<table class="attributeForm" style="width:100%;">')
         for field in fields:
             w(u'<tr>')
@@ -205,7 +205,7 @@
     +--------------+--------------+---------+ 
     """
     display_help = False
-    def _render_fields(self, fields, w, form, values):
+    def _render_fields(self, fields, w, form):
         w(u'<table border="0">')
         w(u'<tr>')
         for field in fields:            
@@ -246,10 +246,10 @@
         if not form.is_subform:
             w(u'</table>')
         
-    def _render_fields(self, fields, w, form, values):
+    def _render_fields(self, fields, w, form):
         if form.is_subform:
             entity = form.edited_entity
-            values = form.req.data.get('formvalues', ())
+            values = form._previous_values
             qeid = eid_param('eid', entity.eid)
             cbsetstate = "setCheckboxesState2('eid', %s, 'checked')" % html_escape(dumps(entity.eid))
             w(u'<tr class="%s">' % (entity.row % 2 and u'even' or u'odd'))
@@ -300,9 +300,9 @@
         if form.edited_entity.has_eid():
             self.relations_form(w, form)
 
-    def _render_fields(self, fields, w, form, values):
+    def _render_fields(self, fields, w, form):
         if not form.edited_entity.has_eid() or form.edited_entity.has_perm('update'):
-            super(EntityFormRenderer, self)._render_fields(fields, w, form, values)
+            super(EntityFormRenderer, self)._render_fields(fields, w, form)
             
     def render_buttons(self, w, form):
         if len(form.form_buttons) == 3:
@@ -458,7 +458,7 @@
         w(u'</fieldset>')
         w(u'<fieldset class="subentity">')
         if fields:
-            self._render_fields(fields, w, form, values)
+            self._render_fields(fields, w, form)
         self.render_child_forms(w, form, values)
         self.inline_entities_form(w, form)
         w(u'</fieldset>')
--- a/web/views/massmailing.py	Fri Apr 17 18:45:06 2009 +0200
+++ b/web/views/massmailing.py	Fri Apr 17 18:51:01 2009 +0200
@@ -80,7 +80,7 @@
 class MassMailingFormRenderer(FormRenderer):
     button_bar_class = u'toolbar'
     
-    def _render_fields(self, fields, w, form, values):
+    def _render_fields(self, fields, w, form):
         w(u'<table class="headersform">')
         for field in fields:
             if field.name == 'mailbody':