【发布时间】:2015-11-12 07:15:48
【问题描述】:
考虑以下代码sn-p:
from google.appengine.ext import ndb
import pprint
class Entity(ndb.Model):
name = ndb.StringProperty()
age = ndb.IntegerProperty()
entity = Entity()
entity.name = "hello"
entity.age = 23
entity.key = ndb.Key(Entity, "p1")
entity.put()
e2 = Entity()
e2.key = ndb.Key(Entity, "p2", parent=ndb.Key(Entity, "p1"))
e2.name = "he11o2"
e2.age = 34
e2.put()
我想查询没有任何记录的Entity表 与之关联的父级。对于上面的示例,它应该只产生 p1 实体。
我怎样才能做到这一点?
【问题讨论】:
标签: python google-app-engine google-cloud-datastore app-engine-ndb