示例#1
0
def tableFromCursor(csr):
    tm = pds.stylesheet.DefaultTable.child()
    for (name, type_code, display_size, internal_size, \
       precision, scale, null_ok) in csr.description:
        tm.addColumn(label=name)
    if pds.beginTable(model=tm):
        pds.setFeeder('plain')
        for raw in csr.fetchall():
            pds.tr(*raw)
        pds.endTable()
示例#2
0
def tableFromCursor(csr):
	tm = pds.stylesheet.DefaultTable.child()
	for (name, type_code, display_size, internal_size, \
		  precision, scale, null_ok) in csr.description:
		tm.addColumn(label=name)
	if pds.beginTable(model=tm):
		pds.setFeeder('plain')
		for raw in csr.fetchall():
			pds.tr(*raw)
		pds.endTable()
示例#3
0
def tableFromQuery(q):
    tm = pds.stylesheet.DefaultTable.child()
    for col in q.getVisibleColumns():
        tm.addColumn(label=col.name)
    if pds.beginTable(model=tm):
        pds.setFeeder('plain')
        for row in q:
            if True:  #pds.beginRow():
                for cell in row:
                    if True:  # pds.beginCell():
                        #value = col.atoms2value(atomicRow)
                        # print col.name + " = " + str(value)
                        #pds.p(str(value))
                        pds.p(cell.format())
                        pds.endCell()
                pds.endRow()
        pds.endTable()
示例#4
0
def tableFromQuery(q):
	tm = pds.stylesheet.DefaultTable.child()
	for col in q.getVisibleColumns():
		tm.addColumn(label=col.name)
	if pds.beginTable(model=tm):
		pds.setFeeder('plain')
		for row in q:
			if True: #pds.beginRow():
				for cell in row:
					if True: # pds.beginCell():
						#value = col.atoms2value(atomicRow)
						# print col.name + " = " + str(value)
						#pds.p(str(value))
						pds.p(cell.format())
						pds.endCell()
				pds.endRow()
		pds.endTable()