[英]Google app engine: Queries
I have a table Foo where my foos are stored and if I log in via browser and list all my foos there is one Foo with ID=12.我有一张 Foo 表,其中存储了我的 foo,如果我通过浏览器登录并列出所有我的 foo,则有一个 ID=12 的 Foo。 Then I have this code:
然后我有这个代码:
logging.info(fid)
q = db.GqlQuery("SELECT * FROM Foo WHERE ID = :1", fid)
logging.info(list(q))
which prints哪个打印
12
[]
If I do q.fetch(4)
it still gives me index out of range.如果我做
q.fetch(4)
它仍然让我的索引超出范围。 What am I doing wrong?我究竟做错了什么? Thanks for your help!
谢谢你的帮助!
get_by_id
is what I was looking for!就是我要找的!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.