當前位置: 首頁>>代碼示例>>Python>>正文


Python Status.put方法代碼示例

本文整理匯總了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)
開發者ID:virtualjoker,項目名稱:jankenpony,代碼行數:26,代碼來源:player.py


注:本文中的status.Status.put方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。