如何将sqlalchemy.engine.result.RowProxy转换为字典?
row = db.engine.execute(sql, id=id).fetchone()
尝试使用SO question中的密码:
for c in inspect(obj).mapper.column_attrs:
model_col = getattr(obj, c.key)
model_dict[c.key] = model_col
错误:
sqlalchemy.exc.NoInspectionAvailable: No inspection system is available for object of type <class 'sqlalchemy.engine.result.RowProxy'>