我想要表示传统HTML(应用程序引擎应用程序)中的G +活动列表。我打了一个电话给G +服务。我收藏了。然后我使用Jinja2发送这个变量。最后,当试图迭代HTML时,我遇到了问题。使用jinja2进行G +集成列表活动
main.py
actividades = servicio.activities().list(userId='me', collection='public', maxResults='2').execute(http=http)
plantilla_values = {
'actividades': actividades,
}
template = Entorno_Jinja.get_template('index.html')
self.response.write(template.render(plantilla_values))
index.html的(使用的Jinja2)
{% for a in actividades%}
<li>{{a}}</li>
{% endfor %}
“ACTIVIDADES” 变量值:
{u'updated': u'2014-10-20T16:55:25.402Z', u'kind': u'plus#activityFeed', u'nextPageToken': u'Cg0Qq5bbpOO7wQIgACgBEhQIABCQ95Om2bvBAhjo-LTftLHBAhgC', u'title': u'Google+ List of Activities for Collection PUBLIC', u'etag': u'"Vea_b94Y77GDGgRK7gFNPnolKQw/TIMAz5AmENqGsq38jyfD5oSPWAs"', u'items': [{u'updated': u'2014-10-20T16:55:25.402Z', u'kind': u'plus#activity', u'actor': {u'image': {u'url': u'https://....
活动模式:
{
"kind": "plus#activityFeed",
"etag": etag,
"nextPageToken": string,
"selfLink": string,
"nextLink": string,
"title": string,
"updated": datetime,
"id": string,
"items": [
activities Resource
]
}
其目标是代表“物品”information.so是一个为其他为。
>> **当试图遍历HTML我有问题** ...有什么问题?你有错误吗?什么错误?没有错误,只是不是你所期望的?你得到了什么,你期望什么? – 2014-10-20 18:32:27
我不知道如何将集合迭代到其他集合中。错误是错误:。我的想法是迭代每个项目并显示“活动资源” –
2014-10-20 22:55:33