I have this code to find all nodes where property branches are empty.
nobranches=TreeNode.all()
for tree in nobranches:
if tree.branches == []:
I wanted to find a better, more efficient way to do this. Meathod, where I do not need to retrieve all TreeNodes. I tried TreeNode.all (). Filter (branches = []), but it gives me a message: "BadValueError (" Filtering by lists is not supported "). How can I do something like TreeNode.gql (" WHERE branches =: 1 ', []). Fetch (100). I tried this, but I get "BadValueError: cannot use empty list as property value, property is []". Is there any other effective way?
By the way, this is what TreeNode Like looks like.
class TreeNode(db.Model):
name = db.StringProperty()
branches =db.ListProperty(db.Key)