本文整理汇总了Python中status.Status.playing方法的典型用法代码示例。如果您正苦于以下问题:Python Status.playing方法的具体用法?Python Status.playing怎么用?Python Status.playing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类status.Status
的用法示例。
在下文中一共展示了Status.playing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enter_game
# 需要导入模块: from status import Status [as 别名]
# 或者: from status.Status import playing [as 别名]
def enter_game(self, game):
game_status = self.get_game_status(game)
if not game_status:
query = Status.all()
query.filter('game =', game)
query.filter('player =', self)
game_status = query.get()
if not game_status:
game_status = Status(player=self, game=game, playing=True)
game_status.playing = True
game_status.put()
if game_status.id not in self.status_ids:
self.status_ids.append(game_status.id)
self.persist = True # It says that it should be saved in database
self.put()
# IT IS VERY WRONG, PLAYER SHOULD BE PUT IN A LIST,
# AND THE LIST SHOULD BE ADDED TO GAME EACH create_match.
game_status.game.add_status(game_status)