我对应用引擎的数据存储有这个问题。在交互式控制台中,当我询问我的数据库中是否已经存在 URL 时,我总是没有得到任何实体。当我执行以下代码时......
from google.appengine.ext import db
class shortURL(db.Model):
url = db.TextProperty()
date = db.DateTimeProperty(auto_now_add=True)
q = shortURL.all()
#q.filter("url =", "httphello")
print q.count()
for item in q:
print item.url
我得到了这个回应,这很好
6
httphello
www.boston.com
http://www.boston.com
httphello
www.boston.com
http://www.boston.com
但是,当我取消注释“q.filter("url =", "httphello")" 行时,我根本没有得到任何实体(响应为 0)。我知道它非常简单,但我就是看不到它!帮助。