Switched to using flask-sqlalchemy