[table view] allow to set None in 'headers', meaning the label should be fetched from the result set as done by default (closes #1931533)
the point of this is to avoid having to define the whole headers list when only
some of them have to be defined.
--- a/web/views/tableview.py Fri Sep 16 12:48:26 2011 +0200
+++ b/web/views/tableview.py Fri Sep 16 12:48:28 2011 +0200
@@ -192,7 +192,9 @@
continue
# compute column header
if headers is not None:
- label = headers[displaycols.index(colindex)]
+ _label = headers[displaycols.index(colindex)]
+ if _label is not None:
+ label = _label
if colindex == mainindex and label is not None:
label += ' (%s)' % self.cw_rset.rowcount
column = TableColumn(label, colindex)