是否可以从db.Model
对象的键不在给定列表中的谷歌应用引擎数据库中进行选择?如果是这样,语法是什么?
例如模型类:
class Spam(db.Model):
field1 = db.BooleanProperty(default=false)
field2 = db.IntegerProperty()
我想工作但无法弄清楚的查询示例:
spam_results = db.GqlQuery(
"SELECT * FROM Spam WHERE key NOT IN :1 LIMIT 10",
['ag1waWNreXByZXNlbnRzchMLEgxBbm5vdW5jZW1lbnQYjAEM',
'ag1waWNreXByZXNlbnRzchMLEgxBbm5vdW5jZW1lbnQYjgEM'])
for eggs in spam_results:
print "id: %s" % a.key().id()