Skip to content
Snippets Groups Projects
Commit 0bc97348 authored by erichard's avatar erichard
Browse files

customable tables : put all the selected attributes into JSON.

We don't know how the label and element tables will b.
That's is the reason why we reused element and label structure
define by the developper of labelstower framework.
parent 024f1a41
No related branches found
No related tags found
1 merge request!67Customisable labelstower
......@@ -11,5 +11,8 @@ def send_query_to_db(query: str) -> List[Dict[int, str]] :
stmt = bp.db.text(query)
response = bp.db.session.execute(stmt)
for row in response:
result.append({"id": row[0], "name": row[1]})
record = {}
for index in range(len(row)):
record.update({str(row.keys()[index]):row[index]})
result.append(record)
return result
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment