예제 #1
0
파일: admin.py 프로젝트: podgib/brownlow
  def get(self, game_id=None):
    if not game_id:
      template = jinja_environment.get_template("templates/game_list.html")
      games = Game.query().order(Game.date).fetch(100)
      self.response.out.write(template.render({'games':games}))
      return

    game = Game.get_by_id(int(game_id))
    if not game:
      self.response.out.write("Error: invalid game ID")
      logging.error("Invalid game ID: " + str(game_id))
      return

    teams = Team.getAll();

    players = Player.query().order(Player.name).fetch(100)
    playing = [p for p in players if p.key in game.players]
    not_playing = [p for p in players if p.key not in game.players]

    template = jinja_environment.get_template("templates/add_edit_game.html")
    args = {'playing':playing,'not_playing':not_playing,'game':game, 'teams':teams}
    self.response.out.write(template.render(args))
예제 #2
0
파일: admin.py 프로젝트: podgib/brownlow
 def get(self):
   teams = Team.getAll()
   template = jinja_environment.get_template("templates/results_menu.html")
   self.response.out.write(template.render({'teams': teams}))
예제 #3
0
파일: admin.py 프로젝트: podgib/brownlow
 def get(self):
   template = jinja_environment.get_template("templates/add_edit_game.html")
   players = Player.query().order(Player.name).fetch(1000)
   teams = Team.getAll()
   args = {'players':players, 'teams':teams}
   self.response.out.write(template.render(args))