Querying for Unique Ancestors of models in Google App Engine DS -
anyone have clean ways unique list of ancestors of entities of particular model?
eg if there class a, , class b(parent=a), can 1 find a's have b's
ended doing 1 liner;
a_with_b = set([b.parent() b in b.all(keys_only=true)]) #list comprehension
fyi, in python 3,
a_with_b = {b.parent() b in b.all(keys_only=true)} #set comprehension
Comments
Post a Comment