2014-07-10 103 views
0

檢索數據庫的內容,我有以下GQL數據庫模型:GAE - 通過命令行

class Post(db.Model): 
subject = db.StringProperty(required = True) 
content = db.TextProperty(required = True) 
created = db.DateTimeProperty(auto_now_add = True) 

這是用於存儲內容數據庫的POST request

def post(self): 
    subject = self.request.get('subject') 
    content = self.request.get('content') 

    if subject and content: 
     a = Post(subject = subject, content = content) 
     a.put() 

     self.redirect("/") 
    else: 
     error = "subject and content can neither be empty" 
     self.Render_NewPost(subject, content, error) 

如果我POST內容到數據庫它工作正常,因爲我沒有得到錯誤。但是,我沒有看到它顯示在網頁上的內容。

我很想知道命令行指令我可以用來檢查數據庫,以確保內容是否post ed實際上是在數據庫中,所以我可以知道在哪裏找出問題的內容沒有在我的主頁上顯示,因爲我希望。

感謝

回答

0

等待30秒,刷新/頁面。您可能會遇到「最終一致性」的問題,數據將「最終」放入您查詢的物理數據存儲區,但可能尚未存在。