Basically, I just want to json encode the results of my sql query.
x = db.session.query(User).filter_by(username = request.form['username'], password = request.form['password']).first()
print vars(x)
return jsonify(x)
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: < User WashingtonGeorge> is not JSON serializable
Here is the result for the print vars(x)
{'_updated': None, 'username': u'WashingtonGeorge', 'password': u'Washington', '_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 0x7fd12a50c8d0>, 'firstname': u'George', 'lastname': u'Washington', '_created': None, 'fullname': u'George Washington', '_id': 1, 'email': u'[email protected]'}