本文整理匯總了Python中status.Status.put方法的典型用法代碼示例。如果您正苦於以下問題:Python Status.put方法的具體用法?Python Status.put怎麽用?Python Status.put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類status.Status
的用法示例。
在下文中一共展示了Status.put方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: enter_game
# 需要導入模塊: from status import Status [as 別名]
# 或者: from status.Status import put [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)