goz.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
class ProjCostReView(RestHandlerView):
store = project_cost_store
def collection_get(self):
result = []
terms = [
and_(ProjectCost.id == PerformedWorkCost.construction_object_info_id)
]
s = select([ProjectCost, PerformedWorkCost]).where(
*terms
).apply_labels()
for row in conn.execute(s):
rec = dict(zip(row.keys(), row))
rec['id'] = rec['construction_object_info_id']
result.append(rec)
return result