I need to do something like this. It looks like in order to a) perform
some operation on my 100 records and update the datastore and b)
render the 100 records in a template, that I have to iterate through
the records twice.
Is this the only way to do this if I want to use a template? Is there
a more efficient way?
results = Foo.all.filter...fetch(100)
# Need to perform some operation on these 100 records
for r in results:
r.column -=1
r.put()
# Now render results using template (will have to loop again).
path = os.path.join(os.path.dirname(__file__), 'Foo.html')
template_values = {
'r': results,
}
self.response.out.write(template.render(path, template_values))
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---