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):
   existing = Team.for_user(users.get_current_user())
   if config['enable_team_adding']:
     self.render('add', { 'existing': existing })
     return
   if config['enable_team_editing']:
     if existing:
       self.render('add', { 'existing': existing })
     else:
       self.render('noadd', { })
Beispiel #3
0
 def post(self):
   team = Team.for_user(users.get_current_user())
   if not team:
       team = Team()
   team.name = self.request.get('name')
   team.people = self.request.get('people')
   location = self.request.get('location')
   team.location = self.request.get('location')
   if location == 'Other':
       team.location = self.request.get('otherLocation')
   team.description = self.request.get('description')
   team.url = self.request.get('url')
   team.video = self.request.get('video')
   team.image = self.request.get('image')
   team.winner = self.request.get('winner')
   team.email = self.request.get('email')
   team.votes = 0
   team.hackday = '092011'
   team.user = users.get_current_user()
   team.put()
   self.render('add_received', { })
Beispiel #4
0
 def get(self):
   existing = Team.for_user(users.get_current_user())
   self.render('add', { 'existing': existing })