本文整理汇总了Python中models.Player.to_message方法的典型用法代码示例。如果您正苦于以下问题:Python Player.to_message方法的具体用法?Python Player.to_message怎么用?Python Player.to_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Player
的用法示例。
在下文中一共展示了Player.to_message方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_player
# 需要导入模块: from models import Player [as 别名]
# 或者: from models.Player import to_message [as 别名]
def create_player(self, request):
"""Create a Player. Optionally set a (non)unique username and email (not validated)"""
# LATER: filter using bleach and profanity pip libs to prevent XSS and xbox live community
# LATER: include funny response when popular slinger names are chosen
email = None
if request.email is not None:
email = request.email
player_name = None
if request.desired_name is not None:
player_name = request.desired_name
player_id = uniq_id()
player = Player(player_id=player_id,
player_name=player_name, player_email=email)
player.put()
return player.to_message()