How to read old property values in a _pre_put_hook
I am trying to implement an ndb model audit so that all changes to properties are stored within each model instance. Here is the code of the _pre_put_hook I chose to implement that. def _pre_put_hook(self): # save a history record for updates if not (self.key is None or self.key.id() is None): old_object = self.key.get(use_cache=True) for attr in dir(self): if not callable(getattr(self, attr)) and not attr.startswith("_"): if getattr(self, attr) != getattr(old_object, attr): logging.debug('UPDATE: {0}'.format(attr)) logging.debug('OLD: {0} NEW: {1}'.format(getattr(old_object, attr), getattr