【发布时间】:2013-06-20 09:18:54
【问题描述】:
class User(UserMixin, ndb.Model):
email = ndb.StringProperty(required = True)
password_hash = ndb.TextProperty(required = True)
class Record(ndb.Model):
user = ndb.KeyProperty(kind=User)
notes = ndb.TextProperty()
在 Django 和我相信经典的 GAE-db 中,您会像这样查询属于用户的记录:
user = "get user instance"
user.record_set.all()
但在 ndb 中,这种方法会引发错误。 Documentation 并没有说明这一点。
知道我将如何实现这一目标吗?谢谢
【问题讨论】:
标签: google-app-engine google-cloud-datastore app-engine-ndb