I am writing small query to fetch the data from mysql
database,
I have a report table, inside that I have report_id
, I need to query the data which matched report_id
coming from api
params.
My function:
def view_single_thumbnail(idx): // idx coming from params
session = Session()
result = session.query(
Report
).filter(
Report.report_id == idx
).all()
return jsonify({
'data': result
})
Throwing error: 'components.db.core.table_declaration.Report object at 0x000001C1Fsdfsdf51E6A90' is not JSON serializable
.