web/views/editviews.py
changeset 8748 f5027f8d2478
parent 8190 2a3c1b787688
child 10666 7f6b5f023884
equal deleted inserted replaced
8747:c0d4244e5abc 8748:f5027f8d2478
    21 _ = unicode
    21 _ = unicode
    22 
    22 
    23 from logilab.common.decorators import cached
    23 from logilab.common.decorators import cached
    24 from logilab.mtconverter import xml_escape
    24 from logilab.mtconverter import xml_escape
    25 
    25 
    26 from cubicweb import typed_eid
       
    27 from cubicweb.view import EntityView, StartupView
    26 from cubicweb.view import EntityView, StartupView
    28 from cubicweb.predicates import (one_line_rset, non_final_entity,
    27 from cubicweb.predicates import (one_line_rset, non_final_entity,
    29                                  match_search_state)
    28                                  match_search_state)
    30 from cubicweb.web import httpcache
    29 from cubicweb.web import httpcache
    31 from cubicweb.web.views import baseviews, linksearch_select_url
    30 from cubicweb.web.views import baseviews, linksearch_select_url
    51 
    50 
    52     @cached
    51     @cached
    53     def filter_box_context_info(self):
    52     def filter_box_context_info(self):
    54         entity = self.cw_rset.get_entity(0, 0)
    53         entity = self.cw_rset.get_entity(0, 0)
    55         role, eid, rtype, etype = self._cw.search_state[1]
    54         role, eid, rtype, etype = self._cw.search_state[1]
    56         assert entity.eid == typed_eid(eid)
    55         assert entity.eid == int(eid)
    57         # the default behaviour is to fetch all unrelated entities and display
    56         # the default behaviour is to fetch all unrelated entities and display
    58         # them. Use fetch_order and not fetch_unrelated_order as sort method
    57         # them. Use fetch_order and not fetch_unrelated_order as sort method
    59         # since the latter is mainly there to select relevant items in the combo
    58         # since the latter is mainly there to select relevant items in the combo
    60         # box, it doesn't give interesting result in this context
    59         # box, it doesn't give interesting result in this context
    61         rql, args = entity.cw_unrelated_rql(rtype, etype, role,
    60         rql, args = entity.cw_unrelated_rql(rtype, etype, role,