Beispiel #1
0
 def get(self):
   existing = Team.for_user(users.get_current_user())
   votes = Votes.for_user(users.get_current_user())
   city = self.get_user_city(votes)
   if city is None:
       self.render('listlocal_fail', {  })
   else:
     all_teams = Team.for_city(city)
     all_teams.sort(key=attrgetter('local_votes'))
     self.render('winnerslocal', { 'teams': all_teams, 'city': city, 'team': existing })
Beispiel #2
0
 def get(self):
   votes = Votes.for_user(users.get_current_user())
   city = self.get_user_city(votes)
   if city is None:
       self.render('listlocal_fail', {  })
   else:
       all_teams = Team.for_city(city)
       votes = Votes.for_user(users.get_current_user())
       for team in all_teams:
           team.voted = (team.key() in votes.local_teams or team.key() in votes.teams)
       self.render('listlocal', { 'city': city, 'teams': all_teams })