I am currently learning Python & Flask. As you know with Flask SQLAlchemy we use the query.all() statement to get all data from our model. For example, defining a GET endpoint to get all users from our User model would require jsonifying the result of User.query.all(). How ever this statement "return jsonify(User.query.all())" returns the error of "TypeError: Object of type 'User' is not JSON serializable".
What is the easiest way or the best practice for jsonifying query.all() result in your GET statement that would list all users in your model?
Thanks.