我一直在尝试运行此查询:
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
非常感谢