cleanup tls-sprint
authorsylvain.thenault@logilab.fr
Wed, 11 Mar 2009 11:19:23 +0100
branchtls-sprint
changeset 1053 e4d965b5ca37
parent 1052 4f746935e6b1
child 1054 434e098f6c76
cleanup
web/form.py
web/views/baseforms.py
--- a/web/form.py	Wed Mar 11 11:18:57 2009 +0100
+++ b/web/form.py	Wed Mar 11 11:19:23 2009 +0100
@@ -753,7 +753,7 @@
                 if value:
                     self.form_add_hidden(param, initial=value)
         self.buttons = buttons or []
-        self.context = {}
+        self.context = None
         
     @property
     def form_needs_multipart(self):
@@ -868,7 +868,8 @@
         if fieldname.startswith('edits-') or fieldname.startswith('edito-'):
             # edit[s|o]- fieds must have the actual value stored on the entity
             if self.entity.has_eid():
-                value = self.form_field_entity_value(field.visible_field, default_initial=False)
+                value = self.form_field_entity_value(field.visible_field,
+                                                     default_initial=False)
             else:
                 value = INTERNAL_FIELD_VALUE
         elif fieldname == '__type':
--- a/web/views/baseforms.py	Wed Mar 11 11:18:57 2009 +0100
+++ b/web/views/baseforms.py	Wed Mar 11 11:19:23 2009 +0100
@@ -25,12 +25,12 @@
 from cubicweb.web import INTERNAL_FIELD_VALUE, stdmsgs, eid_param
 from cubicweb.web.controller import NAV_FORM_PARAMETERS
 from cubicweb.web.widgets import checkbox, InputWidget, ComboBoxWidget
-from cubicweb.web.form import FormMixIn, relation_id
+from cubicweb.web.form import (MultipleFieldsForm, EntityFieldsForm, StringField, 
+                               RichTextField, HiddenInput,
+                               FormMixIn, relation_id)
 
 _ = unicode
 
-from cubicweb.web.form import MultipleFieldsForm, EntityFieldsForm, StringField, \
-     RichTextField, HiddenInput
 
 
 class DeleteConfForm(EntityView):
@@ -77,7 +77,6 @@
     id = 'changestate'
     __method = StringField(name='__method', initial='set_state', widget=HiddenInput)
     state = StringField(widget=HiddenInput, eidparam=True)
-    # XXX format field
     trcomment = RichTextField(eidparam=True)
 
     def form_buttons(self):
@@ -90,10 +89,9 @@
 class ChangeStateFormView(EntityView):
     id = 'statuschange'
     title = _('status change')
-
     __select__ = implements(IWorkflowable) & match_form_params('treid')
 
-    def cell_call(self, row, col, vid='secondary'):
+    def cell_call(self, row, col):
         entity = self.entity(row, col)
         eid = entity.eid
         state = entity.in_state[0]
@@ -115,6 +113,7 @@
     def redirectpath(self, entity):
         return entity.rest_path()
 
+
 class ClickAndEditForm(FormMixIn, EntityView):
     id = 'reledit'
     __select__ = match_kwargs('rtype')