Skip to content

Instantly share code, notes, and snippets.

@dstufft
Created April 7, 2014 10:50
Show Gist options
  • Select an option

  • Save dstufft/10018194 to your computer and use it in GitHub Desktop.

Select an option

Save dstufft/10018194 to your computer and use it in GitHub Desktop.
connection = engine.connect()
transaction = connection.begin()
with connection.connect() as conn:
conn.execute(
""" UPDATE accounts_user
SET password = %(password)s
WHERE username = %(username)s
""",
password=new_hash,
username=username,
)
transaction.rollback()
connection.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment