I am trying to update a value in my table, and add it back in into the database. However, it does not seem to be updating the table when I do db.session.commit
.
Example of Category
table:
Category(id=1, catInfo="{}", products = "[{}]")
Here are my steps:
products2 = json.dumps([{'info': 'info'}])
# I am trying to update products in Category with an ID of 1 with a new list
db.engine.execute("UPDATE products FROM Category WHERE id = 1" + " SET products = " + products2)
# commit the database
db.session.commit()
I am getting TypeError: dict is not a sequence
No idea why