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


Python Game.get_form方法代码示例

本文整理汇总了Python中models.Game.get_form方法的典型用法代码示例。如果您正苦于以下问题:Python Game.get_form方法的具体用法?Python Game.get_form怎么用?Python Game.get_form使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Game的用法示例。


在下文中一共展示了Game.get_form方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_game

# 需要导入模块: from models import Game [as 别名]
# 或者: from models.Game import get_form [as 别名]
 def get_game(self, request):
     """
         gets a single game
     """
     game = get_by_urlsafe(request.urlsafeKey, Game)
     if game == 'Invalid Key':
         game = Game()
         return game.get_form(message="Game not found.")
     else:
         return game.get_form(message="game retrieved.")
开发者ID:phyrenight,项目名称:Udproject4,代码行数:12,代码来源:index.py

示例2: get_history

# 需要导入模块: from models import Game [as 别名]
# 或者: from models.Game import get_form [as 别名]
 def get_history(self, request):
     """
        gets the user's game history.
     """
     user = User.query(User.name == request.name).get()
     if user is None:
         game = Game()
         game.get_form(message="User can not be found")
         return UsersGames(items=game)
     else:
         games = Game.query(Game.user == user.key)
         return UsersGames(items=[i.get_form() for i in games])
开发者ID:phyrenight,项目名称:Udproject4,代码行数:14,代码来源:index.py

示例3: newGame

# 需要导入模块: from models import Game [as 别名]
# 或者: from models.Game import get_form [as 别名]
 def newGame(self, request):
     """
         args: choice - contains the users guessed letter
         creates a new game
         returns: user - urlsafekey based off of the users key
                  hint - definitin of the word
                  word - a randomly generated word
                  progress - astericks string that is as long as the word
     """
     game = Game()
     user = User.query(User.name == request.user_name).get()
     if not user:
         return game.get_form(message="That user does not exist")
     else:
         game = Game.new_game(user.key)
         return game.get_form(message="Good luck!")
开发者ID:phyrenight,项目名称:Udproject4,代码行数:18,代码来源:index.py


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