【发布时间】:2017-10-13 04:20:40
【问题描述】:
这是我在 Google App Engine 中的表格:
class Article:
title = db.StringProperty(required=True)
text = db.TextProperty(required=True)
created = db.DateTimeProperty(auto_now_add=True)
然后我把它渲染到前面:
articles = db.GqlQuery("SELECT * FROM Article ORDER BY created DESC")
self.render("index.html", articles=articles)
我怎样才能得到这一行的 id?像这样:
{% for article in articles %}
{{ article.id }}
{% endfor %}
【问题讨论】:
标签: python google-app-engine google-cloud-datastore webapp2