I ever use get_by_id for get an entity from datastore and never use Ancestor Paths. But the complexity of my models has made it necessary. In fact Ancestor Paths solve a big problem but now when I try to get_by_id an entity return None if the entity have the parent key. This means that I need to add the parent Key:
entity = MyModel.get_by_id(id)
This would becomes:
entity = MyModel.get_by_id(id, parent=key)
How to build the parent Key?
edit:
At this point I prefer to leave ancestor paths and add another keyproperty.
If you want using entity group you can simply create a key like that:
I notice that: You use an upper case for the key parameter. It’s parent not Parent.
Oh, you are using NDB: