python - G+ integration listing activities using jinja2 -
python - G+ integration listing activities using jinja2 -
i'm trying represent list of g+ activities in traditional html (app engine app). made phone call g+ service. collection. send variable using jinja2. when trying iterate on html have problems.
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 (using jinja2)
{% in actividades%} <li>{{a}}</li> {% endfor %}
"actividades" variable value:
{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 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://....
activities schema:
{ "kind": "plus#activityfeed", "etag": etag, "nextpagetoken": string, "selflink": string, "nextlink": string, "title": string, "updated": datetime, "id": string, "items": [ activities resource ] }
the objective represent "items"information.so other for.
"actividades" truncated should like
{% in actividades.items %} <li>{{a.insert_correct_key_or_property_name_here}}</li> {% endfor %}
python google-app-engine google-plus jinja2
Comments
Post a Comment