kill Form, EntityForm and AnyRsetForm tls-sprint
authorsylvain.thenault@logilab.fr
Wed, 18 Feb 2009 11:09:55 +0100
branchtls-sprint
changeset 765 8fda14081686
parent 764 9de67b681624
child 766 33ede72b22b8
kill Form, EntityForm and AnyRsetForm
web/form.py
web/views/baseforms.py
web/views/euser.py
--- a/web/form.py	Wed Feb 18 10:27:09 2009 +0100
+++ b/web/form.py	Wed Feb 18 11:09:55 2009 +0100
@@ -232,20 +232,3 @@
     js = u"javascript: togglePendingDelete('%s', %s);" % (nodeid, html_escape(dumps(eid)))
     return u'[<a class="handle" href="%s" id="handle%s">%s</a>]' % (js, nodeid, label)
 
-
-class Form(FormMixIn, View):
-    """base class for forms. Apply by default according to request form
-    parameters specified using the `form_params` class attribute which
-    should list necessary parameters in the form to be accepted.
-    """
-    __registerer__ = accepts_registerer
-    __select__ = match_form_params()
-
-class EntityForm(FormMixIn, EntityView):
-    """base class for forms applying on an entity (i.e. uniform result set)
-    """
-
-class AnyRsetForm(FormMixIn, AnyRsetView):
-    """base class for forms applying on any empty result sets
-    """
-
--- a/web/views/baseforms.py	Wed Feb 18 10:27:09 2009 +0100
+++ b/web/views/baseforms.py	Wed Feb 18 11:09:55 2009 +0100
@@ -18,17 +18,17 @@
 from cubicweb.selectors import (specified_etype_implements,
                                 match_kwargs, match_form_params, 
                                 one_line_rset, implements)
-from cubicweb.common.utils import make_uid
+from cubicweb.utils import make_uid
+from cubicweb.view import EntityView
 from cubicweb.common.uilib import cut
-from cubicweb.common.view import EntityView
 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 EntityForm, relation_id
+from cubicweb.web.form import FormMixIn, relation_id
 
 _ = unicode
 
-class DeleteConfForm(EntityForm):
+class DeleteConfForm(FormMixIn, EntityView):
     id = 'deleteconf'
     title = _('delete')
     domid = 'deleteconf'
@@ -86,7 +86,7 @@
         self.w(u'</li>')
 
 
-class ChangeStateForm(EntityForm):
+class ChangeStateForm(FormMixIn, EntityView):
     id = 'statuschange'
     title = _('status change')
 
@@ -149,7 +149,7 @@
         return entity.rest_path()
 
 
-class ClickAndEditForm(EntityForm):
+class ClickAndEditForm(FormMixIn, EntityView):
     id = 'reledit'
     __select__ = match_kwargs('rtype')
 
@@ -207,7 +207,7 @@
                 })
 
 
-class EditionForm(EntityForm):
+class EditionForm(FormMixIn, EntityView):
     """primary entity edition form
 
     When generating a new attribute_input, the editor will look for a method
@@ -221,7 +221,7 @@
     id = 'edition'
     title = _('edition')
     controller = 'edit'
-    skip_relations = EntityForm.skip_relations.copy()
+    skip_relations = EntityView.skip_relations.copy()
     
     EDITION_BODY = u'''\
  %(errormsg)s
@@ -775,7 +775,7 @@
        
     
 
-class TableEditForm(EntityForm):
+class TableEditForm(FormMixIn, EntityView):
     id = 'muledit'
     title = _('multiple edit')
 
--- a/web/views/euser.py	Wed Feb 18 10:27:09 2009 +0100
+++ b/web/views/euser.py	Wed Feb 18 11:09:55 2009 +0100
@@ -11,8 +11,9 @@
 
 from cubicweb.schema import display_name
 from cubicweb.selectors import one_line_rset, implements, match_user_groups
+from cubicweb.view import EntityView
 from cubicweb.web import INTERNAL_FIELD_VALUE
-from cubicweb.web.form import EntityForm
+from cubicweb.web.form import FormMixIn
 from cubicweb.web.action import Action
 from cubicweb.web.views.baseviews import PrimaryView, EntityView
 
@@ -93,7 +94,7 @@
         self.cell_call(0, 0)
 
             
-class EditGroups(EntityForm):
+class EditGroups(FormMixIn, EntityView):
     """displays a simple euser / egroups editable table"""
     
     id = 'editgroups'