Пример #1
0
 def post(self, key, **kwargs):
     event = Event.get(key)
     email = self.form.email.data
     invited_users = event.event_user_invited
     for iu in invited_users:
         if email == iu.email:
             return self.redirect('/event/'+str(event.key()))
         else: 
             self.messages.append(('This email was not invited to this event',
                         'error'))
             return self.get(key,**kwargs)
Пример #2
0
 def get(self,key, **kwargs):
         event = Event.get(key)
         if self.auth.user:
         # User is already registered, so don't display the signup form.
             return self.redirect('/event/'+str(key))
 
         opts = {'continue': self.redirect_path(),'event':key}
         context = {
             'facebook_login_url':   self.url_for('auth/invite/facebook', **opts),
             'twitter_login_url':    self.url_for('auth/invite/twitter', **opts)
             
         }
         
         return self.render_response('validate_user.html',section='validate_user',form = self.form,event=event, **context)
Пример #3
0
 def getFile(self, key,size):
 
     event = Event.get(key)
     file = None
     if size == 90:
         file = event.file
     else:
         file = event.file150
         
     result = {
             "file": file,
             "name": str(event.key())+"."+event.filetype
     
             }
     
     return result
Пример #4
0
 def post(self, **kwargs):
     song = Song.get(self.request.form.get('idsong'))
     event = Event.get(self.request.form.get('idevent'))
     sum =  int(self.request.form.get('sum'))
     params = {
                 "event": event,
                 "song": song,
                 "sum": sum
             
           }
     manager = SetListVotesDelegate('SetListVotes')
     manager.update(params)
     slv = event.event_setlist.order('-votes')
     i = 0
     votes = 0
     for s in slv:
         if s.song.key() == song.key():
             votes = s.votes
             break
         i=i+1
     list = {'position' : i,'votes':votes}
     return json.dumps(list)
Пример #5
0
 def get(self,key, **kwargs):
     if self.auth.user:
         slv = Event.get(key).event_setlist.order('-votes')
         return self.render_response('event.html',section='event',setlist = slv,event=Event.get(key))
     else:
         return self.redirect('/event/invitation/'+str(key))
Пример #6
0
 def get(self,key, **kwargs):
     
     
     people = Event.get(key).event_user_invited.filter('status =','voted')
     
     return self.render_response('event_stats.html',people=people)