Created
December 4, 2012 10:46
-
-
Save robertberry-zz/4202591 to your computer and use it in GitHub Desktop.
SQL Alchemy update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update_existing_accounts(session): | |
q = session.query(StaffMember.email, StaffMember.honourific).\ | |
filter(EPrintUser.staff_id == StaffMember.id).\ | |
as_scalar() | |
return session.query(EPrintUser).\ | |
update({EPrintUser.email: q.email, | |
EPrintUser.honourific: q.honourific}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment