svleeuwen
3/14/2016 - 10:59 AM

Use dummy ancestor to achieve strong consistency

Use dummy ancestor to achieve strong consistency

class Item(ndb.Model):
    pass

items = Item.query(ancestor=ndb.Key(Item, 'Items')).fetch()
length1 = len(items)
item = Item(parent=ndb.Key(Item, 'Items'))
item.put()
items = Item.query(ancestor=ndb.Key(Item, 'Items')).fetch()
length2 = len(items)