Reputation: 14256
I'm writing an app in Python + GAE, and I was wondering if it would be possible to attach an event listener to whenever I write a specific type of object to the NDB datastore. Currently I am just calling the function whenever I perform updates, but it would be nicer and safer if this just happened on all such write events.
Upvotes: 0
Views: 112
Reputation: 12986
Have a look at pre and post hooks in ndb.
https://developers.google.com/appengine/docs/python/ndb/modelclass#Model__pre_allocate_ids_hook
and the doc on model hooks https://developers.google.com/appengine/docs/python/ndb/entities#hooks
Upvotes: 1