web/views/tabs.py
branchtls-sprint
changeset 838 f2c56312b03a
parent 782 01801a10c567
child 885 b101d2ae80b4
equal deleted inserted replaced
836:2ca048a43240 838:f2c56312b03a
     9 
     9 
    10 from logilab.common.decorators import monkeypatch
    10 from logilab.common.decorators import monkeypatch
    11 from logilab.mtconverter import html_escape
    11 from logilab.mtconverter import html_escape
    12 
    12 
    13 from cubicweb import NoSelectableObject, role
    13 from cubicweb import NoSelectableObject, role
    14 from cubicweb.selectors import abstract_has_related_entities
    14 from cubicweb.selectors import partial_has_related_entities
    15 from cubicweb.common.view import EntityView
    15 from cubicweb.common.view import EntityView
    16 from cubicweb.common.utils import HTMLHead
    16 from cubicweb.common.utils import HTMLHead
    17 from cubicweb.common.uilib import rql_for_eid
    17 from cubicweb.common.uilib import rql_for_eid
    18 
    18 
    19 from cubicweb.web.views.basecontrollers import JSonController
    19 from cubicweb.web.views.basecontrollers import JSonController
   141     Then, just define as below, and declare this being the tab content :
   141     Then, just define as below, and declare this being the tab content :
   142 
   142 
   143     class ProjectScreenshotTab(DataDependantTab, ProjectScreenshotsView):
   143     class ProjectScreenshotTab(DataDependantTab, ProjectScreenshotsView):
   144         id = 'screenshots_tab'
   144         id = 'screenshots_tab'
   145     """
   145     """
   146     __select__ = EntityView.__select__ & abstract_has_related_entities()
   146     __select__ = EntityView.__select__ & partial_has_related_entities()
   147                                                           
   147                                                           
   148     vid = 'list'
   148     vid = 'list'
   149 
   149 
   150     def cell_call(self, row, col):
   150     def cell_call(self, row, col):
   151         rset = self.entity(row, col).related(self.rtype, role(self))
   151         rset = self.entity(row, col).related(self.rtype, role(self))