web/views/tableview.py
changeset 5508 6718ba5db0eb
parent 5467 57372dbfd114
parent 5504 97ed78b54956
child 5545 25fd74c23f91
equal deleted inserted replaced
5493:c323ff08ad35 5508:6718ba5db0eb
   222             if colindex not in displaycols:
   222             if colindex not in displaycols:
   223                 continue
   223                 continue
   224             # compute column header
   224             # compute column header
   225             if headers is not None:
   225             if headers is not None:
   226                 label = headers[displaycols.index(colindex)]
   226                 label = headers[displaycols.index(colindex)]
   227             if colindex == mainindex:
   227             if colindex == mainindex and label is not None:
   228                 label += ' (%s)' % self.cw_rset.rowcount
   228                 label += ' (%s)' % self.cw_rset.rowcount
   229             column = TableColumn(label, colindex)
   229             column = TableColumn(label, colindex)
   230             coltype = self.cw_rset.description[0][colindex]
   230             coltype = self.cw_rset.description[0][colindex]
   231             # compute column cell view (if coltype is None, it's a left outer
   231             # compute column cell view (if coltype is None, it's a left outer
   232             # join, use the default non final subvid)
   232             # join, use the default non final subvid)
   285         :param row, col: indexes locating the cell value in view's result set
   285         :param row, col: indexes locating the cell value in view's result set
   286         :param cellvid: cell view (defaults to 'outofcontext')
   286         :param cellvid: cell view (defaults to 'outofcontext')
   287         """
   287         """
   288         etype, val = self.cw_rset.description[row][col], self.cw_rset[row][col]
   288         etype, val = self.cw_rset.description[row][col], self.cw_rset[row][col]
   289         if val is not None and not self._cw.vreg.schema.eschema(etype).final:
   289         if val is not None and not self._cw.vreg.schema.eschema(etype).final:
   290             e = self.cw_rset.get_entity(row, col)
   290             self.wview(cellvid or 'outofcontext', self.cw_rset, row=row, col=col)
   291             e.view(cellvid or 'outofcontext', w=self.w)
       
   292         elif val is None:
   291         elif val is None:
   293             # This is usually caused by a left outer join and in that case,
   292             # This is usually caused by a left outer join and in that case,
   294             # regular views will most certainly fail if they don't have
   293             # regular views will most certainly fail if they don't have
   295             # a real eid
   294             # a real eid
   296             self.wview('final', self.cw_rset, row=row, col=col)
   295             self.wview('final', self.cw_rset, row=row, col=col)