Skip to content
Advertisement

Flask-SQLalchemy update a row’s information

How can I update a row’s information?

For example I’d like to alter the name column of the row that has the id 5.

Advertisement

Answer

Retrieve an object using the tutorial shown in the Flask-SQLAlchemy documentation. Once you have the entity that you want to change, change the entity itself. Then, db.session.commit().

For example:

JavaScript

Flask-SQLAlchemy is based on SQLAlchemy, so be sure to check out the SQLAlchemy Docs as well.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement