Commit 269622d5 by aa.gusti

chart

1 parent 57e2e9d2
......@@ -6,16 +6,17 @@ def has_child(DBS, table, kode): #TODO filter parameterized
return row
def calculate_data(DBS, table):
qry = DBS.query(table).order_by(table.kode)
rows = qry.all()
parents = []
results = []
jml = 0
for row in rows:
if has_child(DBS, table, row.kode):
parents.append(dict(id = row.id, kode=row.kode, jumlah=0))
kode = row.kode
jml = 0
else:
if row.jumlah:
jml = jml + row.jumlah
pass
# qry = DBS.query(table).order_by(table.kode)
# rows = qry.all()
# parents = []
# results = []
# jml = 0
# for row in rows:
# if has_child(DBS, table, row.kode):
# parents.append(dict(id = row.id, kode=row.kode, jumlah=0))
# kode = row.kode
# jml = 0
# else:
# if row.jumlah:
# jml = jml + row.jumlah
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!