[views/table] parametrize table view co-classes (closes #1947472) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 22 Sep 2011 16:53:43 +0200
branchstable
changeset 7830 37d23a1d3547
parent 7826 65b7ea00bab8
child 7831 6af00dbfaadd
[views/table] parametrize table view co-classes (closes #1947472)
web/views/tableview.py
--- a/web/views/tableview.py	Thu Sep 22 15:55:58 2011 +0200
+++ b/web/views/tableview.py	Thu Sep 22 16:53:43 2011 +0200
@@ -42,6 +42,9 @@
     title = _('table')
     finalview = 'final'
 
+    table_widget_class = TableWidget
+    table_column_class = TableColumn
+
     def form_filter(self, divid, displaycols, displayactions, displayfilter,
                     paginate, hidden=True):
         try:
@@ -144,7 +147,7 @@
         if paginate:
             self.divid = divid # XXX iirk (see usage in page_navigation_url)
             self.paginate(page_size=page_size, show_all_option=False)
-        table = TableWidget(self)
+        table = self.table_widget_class(self)
         for column in self.get_columns(computed_labels, displaycols, headers,
                                        subvid, cellvids, cellattrs, mainindex):
             table.append_column(column)
@@ -195,7 +198,7 @@
                 label = headers[displaycols.index(colindex)]
             if colindex == mainindex and label is not None:
                 label += ' (%s)' % self.cw_rset.rowcount
-            column = TableColumn(label, colindex)
+            column = self.table_column_class(label, colindex)
             coltype = self.cw_rset.description[0][colindex]
             # compute column cell view (if coltype is None, it's a left outer
             # join, use the default non final subvid)