Skip to content

Instantly share code, notes, and snippets.

@MrYutz
MrYutz / model_to_dict.py
Created Jul 29, 2022 — forked from hrishikeshrt/model_to_dict.py
model_to_dict function for SQLAlchemy
View model_to_dict.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
model_to_dict() functiion for SQLAlchemy models
Based on answers by "doog abides" and "daveoncode" from
https://stackoverflow.com/questions/23554119/convert-sqlalchemy-orm-result-to-dict
@author: Hrishikesh Terdalkar
"""