你好我是Datastore和Python的新手,我有一個基本問題,但它可以幫助我更多地瞭解Google雲。數據存儲App Engine查詢祖先python
我有4個實體,讓我們說我有一個父母(比賽)與孩子:團隊,球員和事件。
class Team(ndb.Model):
d_name = ndb.StringProperty()
d_side = ndb.StringProperty()
class Player(ndb.Model):
d_name = ndb.StringProperty()
date_of_birth = ndb.StringProperty()
d_position = ndb.StringProperty()
d_teamKey = ndb.StringProperty()
class Match(ndb.Model):
d_competition_name = ndb.StringProperty()
d_date = ndb.StringProperty()
d_pool = ndb.StringProperty()
d_season = ndb.StringProperty()
d_team1Key = ndb.StringProperty()
d_team2Key = ndb.StringProperty()
d_winning_teamKey = ndb.StringProperty()
d_match_id = ndb.StringProperty()
d_match_day = ndb.IntegerProperty()
class Event(ndb.Expando):
d_teamKey = ndb.StringProperty()
d_playerKey = ndb.StringProperty()
我知道查詢,如果我想所有4配襯一天是:
q = ndb.gql("SELECT * FROM Match WHERE d_match_day = 4")
但我怎麼能SEACH在論文比賽的孩子們所有的球員,所以,我都誰擁有的球員白天玩4?
謝謝!