I have the following code and need to retrieve faq type questions from a bd, how can I convert the list returned to a json, the following code presents: Object of type 'Question' is not JSON serializable
I'm using flask and Python3
@app.route("/faq/<question>")
@app.route("/faq/",defaults={"question":None})
def teste(question):
r=Question.query.all()
return jsonify(r)
Object of type 'Question' is not JSON serializable