Commit 2a79bd71 authored by vidya.m's avatar vidya.m

Update pos_agg.py

parent fcaf3309
......@@ -60,15 +60,19 @@ class PostgreSQL:
except Exception as e:
print(e, "failed to update the data")
@staticmethod
@staticmethod
def fetch_data():
try:
student_data = session.query(student).all()
list_ = []
for data in student_data:
list_.append(
{"student_id": data.student_id, "student_name": data.student_name, "desciption": data.description,
"address": data.address})
return list_
fetch_data = SqlUtility.fetch_file()
header_label = [" ".join(col.split("_")).title() for col in student.__table__.columns.keys()]
header_value = list(student.__table__.columns.keys())
header = [{"label": label, "value": value} for label, value in zip(header_label, header_value)]
response = {
"header": header,
"body content": fetch_data
}
return response
except Exception as e:
print(e, "Failed to Find the data")
print(e, "failed to find the data")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment