Skip to content

Instantly share code, notes, and snippets.

@dchaplinsky
Created October 22, 2013 12:16
Show Gist options
  • Select an option

  • Save dchaplinsky/7099577 to your computer and use it in GitHub Desktop.

Select an option

Save dchaplinsky/7099577 to your computer and use it in GitHub Desktop.
def _transfer_foo(self, foo_id, new_parent_id):
try:
d = foobar.delete().where(
foobar.c.foo_id == foo_id)
self.session.execute(d)
self._add_relationship(new_parent_id, foo_id)
except:
self.session.rollback()
raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment