Introduce a property to get the tab identifier, to ease overriding
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 25 Aug 2016 16:08:07 +0200
changeset 1568 2121a3e866ef
parent 1567 0bc7c97416c0
child 1569 3894ee20b976
Introduce a property to get the tab identifier, to ease overriding
views/viewlib.py
--- a/views/viewlib.py	Thu Aug 25 11:33:59 2016 +0200
+++ b/views/viewlib.py	Thu Aug 25 16:08:07 2016 +0200
@@ -202,6 +202,10 @@
     rtype_role_targets = None
     subvid = 'seda.listitem'
 
+    @property
+    def tabid(self):
+        return self.__regid__
+
     def entity_call(self, entity):
         self.display_add_button(entity)
         self.display_subobjects_list(entity)
@@ -221,10 +225,10 @@
                 if target is not None:
                     self.w('<h2>%s</h2>' % self._cw.__(target + '_plural'))
                 self._cw.view('list', rset=rset, parent=self.parent(entity), w=self.w,
-                              subvid=self.subvid, tabid=self.__regid__)
+                              subvid=self.subvid, tabid=self.tabid)
 
     def url_params(self, entity):
-        return {'__redirectparams': 'tab=' + self.__regid__}
+        return {'__redirectparams': 'tab=' + self.tabid}
 
     def parent(self, entity):
         return entity