Пример #1
0
 def get_game_history(self, request):
     """Returns the move history for a specified game."""
     game = get_by_urlsafe(request.urlsafe_game_key, Game)
     if game:
         game_history = (GameHistory.query(GameHistory.game == game.key)
                                    .order(GameHistory.turn))
         if game_history:
             return GameHistory.to_form(game_history)
         else:
             raise endpoints.NotFoundException(
                 'No bids have been raised for this game yet')
     else:
         raise endpoints.NotFoundException('Game not found!')