以下是我在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 %}