So, I'm trying to set up a database whose rows will change frequently. Every hour, for example, I want to add a number to a specific part of my database. So, if self.checkmarks is entered into a database equal to 3 , what is the best way to update this part of the database with the added number to make self.checkmarks now equal to 3, 2 ? I tried setting the column as db.Array , but got an attribute error:
AttributeError: SQLAlchemy object does not have 'Array' attribute
I have found how to update the database, but I do not know what is the best way to update it by adding to the list rather than replacing. My approach was as follows, but I do not think append will work because the column cannot be an array:
ven = data.query.filter_by(venid=ven['id']).first() ven.totalcheckins = ven.totalcheckins.append(ven['stats']['checkinsCount']) db.session.commit()
Thank you very much in advance
source share