With old datastore I’ve used keys. Now I have to use ids (taken from NDB Cheat Sheet doc):
user = User.get_by_id(user_id)
if user is None:
user = User(id=user_id)
But looks like this code doesn’t work – the record is added several times.
(user_id is String in my case)
I found the reason, my code above is correct, but my class contained id property:
and it was the problem.