I need to execute some code after i've put my entity in the datastore, with NDB.
let's say i have something like this.
ent=Entity()
ent.put()
def after_put():
assert ...
How can i achieve that without calling manually the function? Is there some sort of trigger or callback i could use?
Yes, you can use "hooks".
https://developers.google.com/appengine/docs/python/ndb/entities#hooks