flask - sqlalchemy execute update where id=3
<p>How can I update <strong>column email</strong> from user table <strong>where id=3</strong>?</p>

<pre><code>from sqlalchemy import update

@app.route('/testupdate/')
def testupdate():
    db.session.execute(update(user, values={user.email: "za@bcdef"}))
    db.session.commit()
    return 'done'
</code></pre>

<pre><code>stmt = user.update().where(user.c.id==3).values(email="za@bcdef")
db.session.execute(stmt)
</code></pre>

<p>see examples in <a href="http://docs.sqlalchemy.org/en/rel_1_0/core/dml.html#sqlalchemy.sql.expression.update" rel="nofollow">documentation</a></p>

python orm sqlalchemy execute