SQLAlchemy execute() return ResultProxy as Tuple, not dict
This is an old question, but still relevant today. Getting SQL Alchemy to return a dictionary is very useful, especially when working with RESTful based APIs that return JSON. Here is how I did it using the db_session in Python 3: resultproxy = db_session.execute(query) d, a = {}, [] for rowproxy in resultproxy: # rowproxy.items() … Read more