开发者

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜