# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1235090979 -3600 # Node ID b101d2ae80b4bcec2d21ec383d26a211b57380ba # Parent 969c16600fb340afffb1f007dfc9e2a86cc9ebf4 no need for both EntityRelatedTab / EntityRelatedView which are doing the same thing diff -r 969c16600fb3 -r b101d2ae80b4 web/views/tabs.py --- a/web/views/tabs.py Fri Feb 20 01:49:00 2009 +0100 +++ b/web/views/tabs.py Fri Feb 20 01:49:39 2009 +0100 @@ -122,10 +122,10 @@ 'cookiename' : self.cookie_name}) -class EntityRelatedTab(EntityView): - """A view you should inherit from leftmost, - to wrap another actual view displaying entity related stuff. - Such a view _must_ provide the rtype, target and vid attributes : + +class EntityRelationView(EntityView): + """view displaying entity related stuff. Such a view _must_ provide rtype + and target attributes Example : @@ -135,20 +135,16 @@ __select__ = implements('Project') rtype = 'screenshot' target = 'object' - vid = 'gallery' - - This is the view we want to have in a tab, only if there is something to show. - Then, just define as below, and declare this being the tab content : - - class ProjectScreenshotTab(DataDependantTab, ProjectScreenshotsView): - id = 'screenshots_tab' """ __select__ = EntityView.__select__ & partial_has_related_entities() - vid = 'list' - + def cell_call(self, row, col): - rset = self.entity(row, col).related(self.rtype, role(self)) + rset = self.rset.get_entity(row, col).related(self.rtype, role(self)) + self.w(u'