# HG changeset patch # User Sylvain Thénault # Date 1316170108 -7200 # Node ID 67f9677c12537c5f551a0f9fd444f255e70a0c1a # Parent ea496a3ed703626237ab9fade68eecd808613ef4 [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. diff -r ea496a3ed703 -r 67f9677c1253 web/views/tableview.py --- 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)