本文整理汇总了Python中models.Game.public_attributes方法的典型用法代码示例。如果您正苦于以下问题:Python Game.public_attributes方法的具体用法?Python Game.public_attributes怎么用?Python Game.public_attributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Game
的用法示例。
在下文中一共展示了Game.public_attributes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models import Game [as 别名]
# 或者: from models.Game import public_attributes [as 别名]
def get(self):
# Can't provide an ordering here in case inequality filters are used.
base_query = Game.all()
count = base_query.count()
results = base_query.fetch(count)
#db.delete(results)
# for game in results:
# resultsobj = resultsobj + simplejson.dumps({"latitude":game.location.lat,"longitude":game.location.lon,"name":game.name,"type":game.game_type})
# objs = simplejson.dumps(resultsobj)
public_attrs = Game.public_attributes()
results_obj = [
_merge_dicts({
'lat': result.location.lat,
'lng': result.location.lon,
},
dict([(attr, getattr(result, attr))
for attr in public_attrs]))
for result in results]
#for song in results:
#print song.type
# for result in query:
# resultsobj.push( "Title: " + result.address
self.response.out.write(simplejson.dumps({
'status': 'success',
'count': count,
'results': results_obj
}))