Reputation: 2169
I am trying to retrieve an entity from a ndb Datastore I know the id and an ancestor (not the parent!)
Although this query works fine when knowing the parent
Entity.get_by_id(int(self.request.get('entityId')),parent=entityParent.key)
The ancestor version is apparently not supported
How should I handle it?
Upvotes: 0
Views: 173
Reputation: 600059
You can't do a get for that, since that is only for exact keys and you don't have one. You need to do an ancestor query:
Entity.query(Query.id==int(self.request.get('entityId')), ancestor=ancestor.key)
Upvotes: 1