Skip to content

Instantly share code, notes, and snippets.

@tell-k
Created September 13, 2012 14:00
Show Gist options
  • Save tell-k/3714517 to your computer and use it in GitHub Desktop.
Save tell-k/3714517 to your computer and use it in GitHub Desktop.
db_session = scoped_session(sessionmaker(bind=engine))
db_session.add(Entry(id=1, text="entrytext")) # <= Insert
db_session.add(Entry(id=2, text="entrytext")) # <= Insert
db_session.flush() # <= このタイミングでDBに反映
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment