Skip to content

Instantly share code, notes, and snippets.

View MiltiadisKoutsokeras's full-sized avatar
🏢
LANGaware

Miltiadis Koutsokeras MiltiadisKoutsokeras

🏢
LANGaware
View GitHub Profile
@hrishikeshrt
hrishikeshrt / model_to_dict.py
Last active December 18, 2023 22:42
model_to_dict function for SQLAlchemy
#!/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
"""