Skip to content Skip to sidebar Skip to footer

Sqlalchemy Adds Significant Overload. Sqlalchemy Object Has No Attribute 'datetime

I have issues with my code, trying to setup SQLAlchemy database in flask using python. Code: Thanks for the help. Tried to reinstall SQLAlchemy. I'm using a corporate laptop, shoul

Solution 1:

For the Warning:

FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled bydefaultin the future.  Set it toTrueorFalseto suppress this warning.
'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and '

Set the 'SQLALCHEMY_TRACK_MODIFICATIONS' to True / False. Preferably False by adding the below line

app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

Immediately after instantiation of the Flask app, i.e., after the below line:

app = Flask(__name__)

For the Error:

 date_created = db.Column(db.dateTime, default=datetime.utcnow)
AttributeError: 'SQLAlchemy'object has no attribute 'dateTime'

There is a typo error, the type is db.DateTime.

Post a Comment for "Sqlalchemy Adds Significant Overload. Sqlalchemy Object Has No Attribute 'datetime"