[forms] remove some deprecation warnings stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 05 Nov 2010 18:48:05 +0100
branchstable
changeset 6690 7d68948015ba
parent 6688 51ddb4842c56
child 6691 17208a358bb1
[forms] remove some deprecation warnings
web/formfields.py
web/views/workflow.py
--- a/web/formfields.py	Fri Nov 05 17:00:41 2010 +0100
+++ b/web/formfields.py	Fri Nov 05 18:48:05 2010 +0100
@@ -428,7 +428,9 @@
                 vocab[i] = option
         return vocab
 
-    def format(self, form):
+    # support field as argument to avoid warning when used as format field value
+    # callback
+    def format(self, form, field=None):
         """return MIME type used for the given (text or bytes) field"""
         if self.eidparam and self.role == 'subject':
             entity = form.edited_entity
--- a/web/views/workflow.py	Fri Nov 05 17:00:41 2010 +0100
+++ b/web/views/workflow.py	Fri Nov 05 18:48:05 2010 +0100
@@ -104,7 +104,7 @@
             'st1': entity.cw_adapt_to('IWorkflowable').printable_state,
             'st2': self._cw._(transition.destination(entity).name)}
         self.w(u'<p>%s</p>\n' % msg)
-        self.w(form.render())
+        form.render(w=self.w)
 
     def redirectpath(self, entity):
         return entity.rest_path()