web/views/tabs.py
branchtls-sprint
changeset 771 ae1b0081ff30
parent 728 a95b284150d1
child 782 01801a10c567
--- a/web/views/tabs.py	Wed Feb 18 11:40:25 2009 +0100
+++ b/web/views/tabs.py	Wed Feb 18 11:41:35 2009 +0100
@@ -11,6 +11,7 @@
 from logilab.mtconverter import html_escape
 
 from cubicweb import NoSelectableObject, role
+from cubicweb.vregistry import objectify_selector
 from cubicweb.selectors import has_related_entities
 from cubicweb.common.view import EntityView
 from cubicweb.common.utils import HTMLHead
@@ -143,7 +144,14 @@
     class ProjectScreenshotTab(DataDependantTab, ProjectScreenshotsView):
         id = 'screenshots_tab'
     """
-    __select__ = EntityView.__select__ & (has_related_entities,)
+    # XXX needs to be generalized
+    @objectify_selector
+    def my_selector(cls, req, rset, row=None, col=0, **kwargs):
+        selector = (EntityView.__select__ &
+                    has_related_entities(cls.rtype, role(cls)))
+        return selector(cls, req, rset, row=None, col=0, **kwargs)
+
+    __select__ = my_selector()
     vid = 'list'
 
     def cell_call(self, row, col):