Ejemplo n.º 1
0
  def DoGet(self):

    logging.info('Calculating ELO rankings')
    # Reset ranks
    for player in Player.all():
      player.rank = elo.INITIAL_RANK
      player.put()

    # Calculate ranks for games in ascending order, since the order matters for ELO
    for game in Game.all_completed_asc():
      logging.info('Updating rankings based on game completed at %s:  %s' % (game.completed_date, game))
      elo.update_ranks(game)
      game.player_1.put()
      game.player_2.put()

    self.render_to_response("calculate_elo_rankings.html")