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