how to convert Sqlalchemy query result to JSON data [duplicate]
Just put the data into a dictionary and dump the dictionary, or am I missing something:
data = { 'company': merchant.company, 'agent': merchant.agent, 'user': merchant.user, 'fullname': merchant.fullname 'dob': merchant.dob ...}jsonified_data = json.dumps(data)
And use json.loads
when loading a JSON string.
json.loads(jsonified_data)