在python中为google-app-engine获取expando模型属性

时间:2010-05-21 16:34:29

标签: python google-app-engine

如何从expando模型中获取所有属性? (不只是Model.properties())

我想做这样的事情:

...
recs = query.fetch( 100 )

for rec in recs:

    for name, value in rec.iteritem():
        # figure out what, if any, expando properties are in this record

但是Model.iteritem()不存在

这似乎很容易过来,但我有点难过 谢谢!

1 个答案:

答案 0 :(得分:2)

rec.dynamic_properties()将为您提供Expando属性列表

http://code.google.com/appengine/docs/python/datastore/modelclass.html#Model_dynamic_properties