当前位置: 首页>>代码示例>>Python>>正文


Python Player.to_message方法代码示例

本文整理汇总了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()
开发者ID:bschmoker,项目名称:highnoon,代码行数:23,代码来源:api.py


注:本文中的models.Player.to_message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。