In Python, using SQLAlchemy, I want to insert or update a row. I tried this:
existing = db.session.query(Toner)
for row in data:
new = Toner(row[0], row[1], row[2])
It does not work. How do I INSERT or UPDATE new
into Toner
table? I suspect it's done with merge, but I cannot understand how to do that.