Skip to content

Instantly share code, notes, and snippets.

@ianjosephwilson
Created November 12, 2013 20:26
Show Gist options
  • Save ianjosephwilson/7438043 to your computer and use it in GitHub Desktop.
Save ianjosephwilson/7438043 to your computer and use it in GitHub Desktop.
@ndb.transactional(xg=True)
def remove(self, new_rep_id=None):
# Un-assign this rep from all their stores.
stores = Store.query_stores(rep_id = self.key, active=None)
for store in stores:
store.rep_id = new_rep_id
store.put()
self.active = False
self.put()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment