我與應用程序引擎的數據存儲有此問題。在交互式控制檯中,當我問我的數據庫中是否存在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)。我知道它非常簡單,但我看不到它!幫幫我。
是的,這幾乎做到了。謝謝 – Chad 2011-04-04 05:51:45