本文整理汇总了Python中models.Match.get_data方法的典型用法代码示例。如果您正苦于以下问题:Python Match.get_data方法的具体用法?Python Match.get_data怎么用?Python Match.get_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Match
的用法示例。
在下文中一共展示了Match.get_data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _trigger_played_match
# 需要导入模块: from models import Match [as 别名]
# 或者: from models.Match import get_data [as 别名]
def _trigger_played_match(self, match_type):
if MatchSoloQueue.query(MatchSoloQueue.type == match_type).count() >= 2:
match_solo_queues = [match_queue for match_queue in MatchSoloQueue.query(MatchSoloQueue.type == match_type).fetch(10)]
players = [match_queue.player.get() for match_queue in match_solo_queues]
match = Match(type=match_type)
match.setup_soloqueue_match(players)
ndb.delete_multi([queue.key for queue in match_solo_queues])
for player in players:
player.doing = match.key
player.put()
websocket_notify_player("Player_MatchFound", player.key, None, match.get_data())
示例2: post
# 需要导入模块: from models import Match [as 别名]
# 或者: from models.Match import get_data [as 别名]
def post(self):
player = current_user_player()
if player.doing:
error_400(self.response, "ERROR_PLAYER_BUSY", "Player is busy.")
return
bot_match = Match(type="Bot")
bot_match.setup_bot_match(player)
player.doing = bot_match.key
player.put()
set_json_response(self.response, bot_match.get_data("full"))