Loop over GqlQuery Fields, App Engine, Python
I want to output all attributes and values of the following GqlQuery:
benchmarks = db.GqlQuery("SELE开发者_开发知识库CT * FROM Benchmarks")
What's the easiest way to loop over the GqlQuery and output the names and values generically?
To be more precise, I DO NOT want to do this:
benchmarks = db.GqlQuery("SELECT * FROM Benchmarks")
for b in benchmarks:
self.response.out.write("<td>name:%s</td>" % b.name)
self.response.out.write("<td>Id:%s</td>" % b.id)
But rather have all properties of a benchmark displayed, independent of their name.
Thanks for any advice!
精彩评论