# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1234951795 -3600 # Node ID 8fda1408168646aad03e8a82e251977b2d916b8d # Parent 9de67b681624faf8a5bf183ac85411702d93431f kill Form, EntityForm and AnyRsetForm diff -r 9de67b681624 -r 8fda14081686 web/form.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'[%s]' % (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 - """ - diff -r 9de67b681624 -r 8fda14081686 web/views/baseforms.py --- 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'') -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') diff -r 9de67b681624 -r 8fda14081686 web/views/euser.py --- 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'