I've got some models on my GAE app, and I've overriden put()
on some of them. When I call db.put()
with a list of these entites, is there a guarantee that the overriden put()
on each entity will be called?
What I'm seeing right now is that the entities are just getting saved without it being called. Is there any good way to make sure stuff is done before every save, even batches?
No. You need to monkeypatch
db.put()
too. For a good example of this, check out Nick Johnson's excellent blog post on Pre- and post- put hooks for Datastore models.If you look at the source code for the
db
module, you'll see thatdb.put()
does not call the entity'sput()
function.