web/views/tabs.py
branchtls-sprint
changeset 782 01801a10c567
parent 771 ae1b0081ff30
child 838 f2c56312b03a
--- a/web/views/tabs.py	Wed Feb 18 11:50:15 2009 +0100
+++ b/web/views/tabs.py	Wed Feb 18 13:36:28 2009 +0100
@@ -11,8 +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.selectors import abstract_has_related_entities
 from cubicweb.common.view import EntityView
 from cubicweb.common.utils import HTMLHead
 from cubicweb.common.uilib import rql_for_eid
@@ -144,14 +143,8 @@
     class ProjectScreenshotTab(DataDependantTab, ProjectScreenshotsView):
         id = 'screenshots_tab'
     """
-    # 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()
+    __select__ = EntityView.__select__ & abstract_has_related_entities()
+                                                          
     vid = 'list'
 
     def cell_call(self, row, col):