我想从 Google Appengine ndb 获取一些数据。我有以下代码
keys = []
for field in self.request.arguments():
keys.append(ndb.Key(models.MyModel, int(id)))
# Some unrelevant code
for k in keys:
logging.info(k)
m = ndb.get_multi(keys)
for p in m:
logging.info(p)
这给了我这个输出:
INFO 2012-09-07 13:18:23,436 main.py:58] Key('MyModel', 42)
INFO 2012-09-07 13:18:23,436 main.py:58] Key('MyModel', 44)
INFO 2012-09-07 13:18:23,437 main.py:58] Key('MyModel', 42)
INFO 2012-09-07 13:18:23,437 main.py:58] Key('MyModel', 43)
INFO 2012-09-07 13:18:23,437 main.py:58] Key('MyModel', 44)
INFO 2012-09-07 13:18:23,443 main.py:62] None
INFO 2012-09-07 13:18:23,443 main.py:62] None
INFO 2012-09-07 13:18:23,443 main.py:62] None
INFO 2012-09-07 13:18:23,443 main.py:62] None
INFO 2012-09-07 13:18:23,444 main.py:62] None
我确定模型存在于具有该 ID 号的数据存储中。那么我做错了什么?