Sqlalchemy Hack - How to convert a table to dict on the fly

from blog Prahlad Yeri, | ↗ original
In on of my recent projects, I came across the need to develop a JSON based REST API to fetch data from the sqlalchemy objects. Now, the Query object is a great way to access data using the powerful sqlalchemy orm, but it doesn’t give any built-in way to convert the result-set into a python dict. For instance, I have a Professor table in my...