I’m using GAE with python and I came across this problem, I’m trying to do something like this:
db.delete(db.Query(StudentVote).filter('topic.lecture = ', lecture))
and
db.delete(db.Query(StudentVote).filter('topic.lecture.course.owner = ', owner))
I try to delete a group of entities, each one have a topic property which has lecture property and so on.
StudentVote-> topic-> lecture-> course->
owner
But the query doesn’t work, is there any way to filter that way? a or what is the best practice acomplish this functionality?
Thanks advanced, Gal.
If this is a common query, you’d want to put the owner as an indexed property in the StudentVote. This would make your writes a bit more expensive, but it would let you query by owner. Otherwise, if it’s rare and performance is not a problem, you could manually query through the chain.