def get(self):
query = db.GqlQuery("Select * from TaskLog")
TaskLogs= query.get();
self.renderPage('templates/list.html', TaskLogs)
--------Template ------------
{%for TaskLog in TaskLogs%}
----------------------------------
There are two things wrong with this python code
The second arg to renderPage must be a dictionary with key-value pairs
self.renderPage('templates/list.html', {'TaskLogs':TaskLogs})
The template for loop needs an iterable in the var TaskLogs in the
context (the dict arg of renderPage). query.get() does not return an
iterable.
self.renderPage('templates/list.html', {'TaskLogs':[TaskLogs]})
The original TaskLogs is by Django interpreted as a context and asked
for a certain dictionary key ('forloop') with has_key(key). But it is
a db.Model instance with a has_key(self,key) method.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---