web/views/baseviews.py
changeset 237 3df2e0ae2eba
parent 213 6842c3dee34b
child 251 de7e74ff03f8
equal deleted inserted replaced
236:8ab9e72dd8f1 237:3df2e0ae2eba
    19 
    19 
    20 from logilab.common.decorators import cached
    20 from logilab.common.decorators import cached
    21 from logilab.mtconverter import html_escape, TransformError
    21 from logilab.mtconverter import html_escape, TransformError
    22 
    22 
    23 from cubicweb import Unauthorized, NoSelectableObject, typed_eid
    23 from cubicweb import Unauthorized, NoSelectableObject, typed_eid
    24 from cubicweb.common.selectors import (yes_selector, anyrset_selector, accept_selector,
    24 from cubicweb.common.selectors import (yes, nonempty_rset, accept_selector,
    25                                     onelinerset_selector, searchstate_selector, 
    25                                     one_line_rset, searchstate_selector, 
    26                                     req_form_params_selector, accept_rset_selector)
    26                                     req_form_params_selector, accept_rset_selector)
    27 from cubicweb.common.uilib import (cut, printable_value,  UnicodeCSVWriter,
    27 from cubicweb.common.uilib import (cut, printable_value,  UnicodeCSVWriter,
    28                                 ajax_replace_url, rql_for_eid)
    28                                 ajax_replace_url, rql_for_eid)
    29 from cubicweb.common.view import EntityView, AnyRsetView, EmptyRsetView
    29 from cubicweb.common.view import EntityView, AnyRsetView, EmptyRsetView
    30 from cubicweb.web.httpcache import MaxAgeHTTPCacheManager
    30 from cubicweb.web.httpcache import MaxAgeHTTPCacheManager
    34 
    34 
    35 
    35 
    36 class NullView(AnyRsetView):
    36 class NullView(AnyRsetView):
    37     """default view when no result has been found"""
    37     """default view when no result has been found"""
    38     id = 'null'
    38     id = 'null'
    39     __select__ = classmethod(yes_selector)
    39     __select__ = classmethod(yes)
    40     def call(self, **kwargs):
    40     def call(self, **kwargs):
    41         pass
    41         pass
    42     cell_call = call
    42     cell_call = call
    43 
    43 
    44 
    44 
   759     """view called by the edition view when the user asks
   759     """view called by the edition view when the user asks
   760     to search for something to link to the edited eid
   760     to search for something to link to the edited eid
   761     """
   761     """
   762     id = 'search-associate'
   762     id = 'search-associate'
   763     title = _('search for association')
   763     title = _('search for association')
   764     __selectors__ = (onelinerset_selector, searchstate_selector, accept_selector)
   764     __selectors__ = (one_line_rset, searchstate_selector, accept_selector)
   765     accepts = ('Any',)
   765     accepts = ('Any',)
   766     search_states = ('linksearch',)
   766     search_states = ('linksearch',)
   767 
   767 
   768     def cell_call(self, row, col):
   768     def cell_call(self, row, col):
   769         rset, vid, divid, paginate = self.filter_box_context_info()
   769         rset, vid, divid, paginate = self.filter_box_context_info()