def __init__(self, title, **args): Table.__init__(self, **args) self.row = TableRow() self.td = TableCell() self.append(self.row) self.row.append(self.td) self.set_title(title)
def __init__(self, fields, idcol, action, record, **atts): Table.__init__(self, **atts) self.record = record refdata = None if hasattr(record, '_refdata'): refdata = record._refdata for field in fields: # make url first if action if action: stringlist = map(str, [action, field, record[idcol]]) url = '.'.join(stringlist) row = TableRow() keycell = TableCell() keycell.set(Bold(field)) row.append(keycell) valcell = TableCell() # the following code needs more comments # this should be a private method called _make_valcell if refdata is not None and field in refdata.cols: ridcol = refdata.cols[field] refrec = refrec.data[field][record[ridcol]] node = refdata.object[field](refrec) if action: valcell.set(Anchor(node, href=url)) else: valcell.set(node) elif action: valcell.set(Anchor(record[field], href=url)) else: valcell.set(record[field]) row.append(valcell) self.val = valcell self.key = keycell self.append(row)
def __init__(self, fields, row, **atts): Table.__init__(self, **atts) for field in fields: row = TableRow() field_cell = TableCell(field) row.append(field_cell) value_cell = TableCell(row[field]) row.append(value_cell) self.append(row)
def __init__(self, title, **attributes): Table.__init__(self, **attributes) self.row = TableRow() self.cell = TableCell() self.set(self.row) self.row.set(self.cell) self.h1 = Header(level=1) self._font = Font(color='gold') self.cell.set(self.h1) self.h1.set(self._font) self.set_title(title)
def __init__(self, rows, **atts): Table.__init__(self, **atts) headrow = TableRow() headrow.append(TableCell(Bold('Trait'))) headrow.append(TableCell(Bold('Order'))) self.set(headrow) for row in rows: tablerow = TableRow() tablerow.append(TableCell(row.trait)) tablerow.append(TableCell(str(row.ord))) self.append(tablerow)
def __init__(self, rows, **atts): Table.__init__(self, **atts) headrow = TableRow(bgcolor='MistyRose3') headrow.append(TableHeader('Trait')) headrow.append(TableHeader('Name')) headrow.append(TableHeader('Value')) self.set(headrow) for row in rows: tablerow = TableRow() tablerow.append(TableCell(row.trait)) tablerow.append(TableCell(row.name)) tablerow.append(TableCell(row.value)) self.append(tablerow)
def __init__(self, fields, idcol, action, record, **args): Table.__init__(self, **args) self.record = record for field in fields: row = TableRow() row.append(TableCell(Bold(field))) val = TableCell() data = str(record[field]) if action: href = '%s?%s=%s' % (action, idcol, record[idcol]) a = Anchor(data, href=href) val.append(a) else: val.append(data) row.append(val) self.append(row)
def __init__(self, rows, **atts): Table.__init__(self, **atts) packages = [] package_actions = {} for row in rows: if row.package not in packages: packages.append(row.package) package_actions[row.package] = [row.action] else: package_actions[row.package].append(row.action) for package in packages: tablerow = TableRow() tablerow.append(TableCell(package)) tablerow.append(TableCell(', '.join(package_actions[package]))) anchor = Anchor('delete', href='delete.package.%s' % package) tablerow.append(anchor) self.append(tablerow)
def __init__(self, fields, idcol, action, record, **args): Table.__init__(self, **args) self.record = record refdata = None if hasattr(record, '_refdata'): refdata = record._refdata for field in fields: row = TableRow() row.append(TableCell(Bold(field))) val = TableCell() data = str(record[field]) if refdata is not None and field in refdata.cols: print 'hello there - fix me' elif action: val.append(Anchor(data, href=action)) else: val.append(data) row.append(val) self.append(row)
def __init__(self, app, class_="BaseMainTable", border=1, cellspacing=0, width="100%", **args): Table.__init__(self, class_=class_, border=border, cellspacing=cellspacing, width=width) self.app = app
def __init__(self, rows, **atts): Table.__init__(self, **atts) self.set_rows(rows)
def __init__(self, border=1, **args): Table.__init__(self, border=border, **args)
def __init__(self, **atts): Table.__init__(self, **atts)