我有兩種:如何才達到加入情景在谷歌數據存儲NDB(Python庫)
class Professor(ndb.Model):
name = ndb.StringProperty()
email = ndb.StringProperty()
class Student(ndb.Model):
professor = ndb.KeyProperty(kind=Professor)
name = ndb.StringProperty()
age = ndb.IntegerProperty()
我想找到的所有學生的實體,其中教授的名字是「斯內普」。我怎樣才能做到這一點?
或者如果我採取https://cloud.google.com/appengine/articles/modeling的「一對多」示例。然後,我想查找Contact.name爲「scott」的所有PhoneNumber實體。這個怎麼做。
appengine示例只說明如何過濾PhoneNumber屬性。如果我想過濾相關的種類,即聯繫人屬性,該怎麼辦?
這個問題有點堆棧溢出。我建議在[App Engine Google Group](https://groups.google.com/forum/#!forum/google-appengine)上發佈此信息以獲得更適合的最佳實踐類型的討論。我還建議包括一些你已經嘗試或考慮過的方法的例子。 – Nicholas