I have a sqlalchemy result
labels = session.query(
LabelsData,
LabelsData.id,
LabelsData.name,
LabelsData.color
).filter(LabelsData.deleted==False).all()
And I want convert this result to JSON, but how I can do it?
It looks like your
LabelsDataobject is a SQLAlchemy model. You need to serialize it before dumping it to JSON. Here’s a short example that extracts all the columns from yourLabelsDataobject and converts the results of your query to JSON: