Changed to Flask-SQLAlchemy, and also changed some attributes that were mistaken