my_post = db.GqlQuery("SELECT * FROM Post where __key__ = KEY('Post', 1)")
self.render("showpost.html", my_post = my_post)
を、私のテンプレート
showpost.html
は次のようになります。
<div class="post">
<h3 class="post-subject">{{ my_post.subject }}</h3>
<div class="post-content">{{ my_post.content }}</div>
</div
の代わりに私はid=1
のポストの詳細を取得します空白のページを取得します。 id = 1の投稿がありますが、GQLqueryが実際に何かを返すかどうかを確認する方法がわかりません。確認する方法はありますか?次のことをしようとしてオン :
my_post = db.GqlQuery("SELECT * FROM Post where subject = 'hello_world')
self.render("showpost.html", my_post = my_post)
私は、被験者のポストがあっても、同じ問題(空白ページ)を取得するには、hello_world
どうもありがとう
このチップをありがとう。私は代わりにこれを使用します。どうもありがとう :) – Prakhar