web/views/editforms.py
branchstable
changeset 4649 9a6db1eb12ff
parent 4641 9d8903b04031
child 4668 9f82f81bf13d
equal deleted inserted replaced
4648:cf3b35545602 4649:9a6db1eb12ff
    15 
    15 
    16 from logilab.mtconverter import xml_escape
    16 from logilab.mtconverter import xml_escape
    17 from logilab.common.decorators import cached
    17 from logilab.common.decorators import cached
    18 
    18 
    19 from cubicweb.selectors import (match_kwargs, one_line_rset, non_final_entity,
    19 from cubicweb.selectors import (match_kwargs, one_line_rset, non_final_entity,
    20                                 specified_etype_implements, yes)
    20                                 specified_etype_implements, implements, yes)
    21 from cubicweb.view import EntityView
    21 from cubicweb.view import EntityView
    22 from cubicweb import tags
    22 from cubicweb import tags
    23 from cubicweb.web import uicfg, stdmsgs, eid_param, \
    23 from cubicweb.web import uicfg, stdmsgs, eid_param, \
    24      formfields as ff, formwidgets as fw
    24      formfields as ff, formwidgets as fw
    25 from cubicweb.web.form import FormViewMixIn, FieldNotFound
    25 from cubicweb.web.form import FormViewMixIn, FieldNotFound
    28 _pvdc = uicfg.primaryview_display_ctrl
    28 _pvdc = uicfg.primaryview_display_ctrl
    29 
    29 
    30 
    30 
    31 class DeleteConfForm(forms.CompositeForm):
    31 class DeleteConfForm(forms.CompositeForm):
    32     __regid__ = 'deleteconf'
    32     __regid__ = 'deleteconf'
    33     __select__ = non_final_entity()
    33     # XXX non_final_entity does not implement eclass_selector
       
    34     __select__ = implements('Any')
    34 
    35 
    35     domid = 'deleteconf'
    36     domid = 'deleteconf'
    36     copy_nav_params = True
    37     copy_nav_params = True
    37     form_buttons = [fw.Button(stdmsgs.BUTTON_DELETE, cwaction='delete'),
    38     form_buttons = [fw.Button(stdmsgs.BUTTON_DELETE, cwaction='delete'),
    38                     fw.Button(stdmsgs.BUTTON_CANCEL, cwaction='cancel')]
    39                     fw.Button(stdmsgs.BUTTON_CANCEL, cwaction='cancel')]
    39     @property
       
    40     def action(self):
       
    41         return self._cw.build_url('edit')
       
    42 
    40 
    43     def __init__(self, *args, **kwargs):
    41     def __init__(self, *args, **kwargs):
    44         super(DeleteConfForm, self).__init__(*args, **kwargs)
    42         super(DeleteConfForm, self).__init__(*args, **kwargs)
    45         done = set()
    43         done = set()
    46         for entity in self.cw_rset.entities():
    44         for entity in self.cw_rset.entities():