本文整理汇总了Python中models.Player.get_by_key_name方法的典型用法代码示例。如果您正苦于以下问题:Python Player.get_by_key_name方法的具体用法?Python Player.get_by_key_name怎么用?Python Player.get_by_key_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Player
的用法示例。
在下文中一共展示了Player.get_by_key_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DoGet
# 需要导入模块: from models import Player [as 别名]
# 或者: from models.Player import get_by_key_name [as 别名]
def DoGet(self, player_key_name):
player_to_show = Player.get_by_key_name(player_key_name)
logging.info('Getting player %s' % player_to_show)
if not self.player:
self.error(404)
self.response.out.write("""<strong>No player with key %s.
Try looking through the <a href="/players">list of players</a>.</strong>""" % player_key_name)
additional_values = {
'player_to_show' : player_to_show,
'available_games' : player_to_show.available_games(),
'completed_games' : player_to_show.completed_games(),
'active_games' : player_to_show.active_games(),
'stats' : stats(player_to_show)
}
self.template_values.update(additional_values)
self.render_to_response("player.html")