Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)
Esempio n. 5
0
 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)
Esempio n. 6
0
 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)
Esempio n. 7
0
 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)
Esempio n. 8
0
 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)
Esempio n. 9
0
 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)
Esempio n. 10
0
 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)
Esempio n. 11
0
 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
Esempio n. 12
0
 def __init__(self, rows, **atts):
     Table.__init__(self, **atts)
     self.set_rows(rows)
Esempio n. 13
0
 def __init__(self, rows, **atts):
     Table.__init__(self, **atts)
     self.set_rows(rows)
Esempio n. 14
0
 def __init__(self, border=1, **args):
     Table.__init__(self, border=border, **args)
Esempio n. 15
0
 def __init__(self, **atts):
     Table.__init__(self, **atts)
Esempio n. 16
0
 def __init__(self, **atts):
     Table.__init__(self, **atts)