[table view] take care to None label stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 10 May 2010 15:14:13 +0200
branchstable
changeset 5503 5b7eb0839da3
parent 5502 c342531032a1
child 5504 97ed78b54956
[table view] take care to None label
web/htmlwidgets.py
web/views/tableview.py
--- a/web/htmlwidgets.py	Fri May 07 20:07:54 2010 +0200
+++ b/web/htmlwidgets.py	Mon May 10 15:14:13 2010 +0200
@@ -326,7 +326,7 @@
         self.w(u'<tr class="header">')
         for column in self.columns:
             attrs = ('%s="%s"' % (name, value) for name, value in column.cell_attrs.iteritems())
-            self.w(u'<th %s>%s</th>' % (' '.join(attrs), column.name))
+            self.w(u'<th %s>%s</th>' % (' '.join(attrs), column.name or u''))
         self.w(u'</tr>')
         self.w(u'</thead><tbody>')
         for rowindex in xrange(len(self.model.get_rows())):
--- a/web/views/tableview.py	Fri May 07 20:07:54 2010 +0200
+++ b/web/views/tableview.py	Mon May 10 15:14:13 2010 +0200
@@ -224,7 +224,7 @@
             # compute column header
             if headers is not None:
                 label = headers[displaycols.index(colindex)]
-            if colindex == mainindex:
+            if colindex == mainindex and label is not None:
                 label += ' (%s)' % self.cw_rset.rowcount
             column = TableColumn(label, colindex)
             coltype = self.cw_rset.description[0][colindex]