web/views/editviews.py
changeset 2789 39712da6f397
parent 2650 18aec79ec3a3
child 3023 7864fee8b4ec
equal deleted inserted replaced
2788:8d3dbe577d3a 2789:39712da6f397
    41         self.wview(vid, rset, 'noresult')
    41         self.wview(vid, rset, 'noresult')
    42         self.w(u'</div>')
    42         self.w(u'</div>')
    43 
    43 
    44     @cached
    44     @cached
    45     def filter_box_context_info(self):
    45     def filter_box_context_info(self):
    46         entity = self.entity(0, 0)
    46         entity = self.rset.get_entity(0, 0)
    47         role, eid, rtype, etype = self.req.search_state[1]
    47         role, eid, rtype, etype = self.req.search_state[1]
    48         assert entity.eid == typed_eid(eid)
    48         assert entity.eid == typed_eid(eid)
    49         # the default behaviour is to fetch all unrelated entities and display
    49         # the default behaviour is to fetch all unrelated entities and display
    50         # them. Use fetch_order and not fetch_unrelated_order as sort method
    50         # them. Use fetch_order and not fetch_unrelated_order as sort method
    51         # since the latter is mainly there to select relevant items in the combo
    51         # since the latter is mainly there to select relevant items in the combo
    58 
    58 
    59 
    59 
    60 class OutOfContextSearch(EntityView):
    60 class OutOfContextSearch(EntityView):
    61     id = 'outofcontext-search'
    61     id = 'outofcontext-search'
    62     def cell_call(self, row, col):
    62     def cell_call(self, row, col):
    63         entity = self.entity(row, col)
    63         entity = self.rset.get_entity(row, col)
    64         erset = entity.as_rset()
    64         erset = entity.as_rset()
    65         if self.req.match_search_state(erset):
    65         if self.req.match_search_state(erset):
    66             self.w(u'<a href="%s" title="%s">%s</a>&nbsp;<a href="%s" title="%s">[...]</a>' % (
    66             self.w(u'<a href="%s" title="%s">%s</a>&nbsp;<a href="%s" title="%s">[...]</a>' % (
    67                 xml_escape(linksearch_select_url(self.req, erset)),
    67                 xml_escape(linksearch_select_url(self.req, erset)),
    68                 self.req._('select this entity'),
    68                 self.req._('select this entity'),
    76 class UnrelatedDivs(EntityView):
    76 class UnrelatedDivs(EntityView):
    77     id = 'unrelateddivs'
    77     id = 'unrelateddivs'
    78     __select__ = match_form_params('relation')
    78     __select__ = match_form_params('relation')
    79 
    79 
    80     def cell_call(self, row, col):
    80     def cell_call(self, row, col):
    81         entity = self.entity(row, col)
    81         entity = self.rset.get_entity(row, col)
    82         relname, target = self.req.form.get('relation').rsplit('_', 1)
    82         relname, target = self.req.form.get('relation').rsplit('_', 1)
    83         rschema = self.schema.rschema(relname)
    83         rschema = self.schema.rschema(relname)
    84         hidden = 'hidden' in self.req.form
    84         hidden = 'hidden' in self.req.form
    85         is_cell = 'is_cell' in self.req.form
    85         is_cell = 'is_cell' in self.req.form
    86         self.w(self.build_unrelated_select_div(entity, rschema, target,
    86         self.w(self.build_unrelated_select_div(entity, rschema, target,