예제 #1
0
 def post(self):
     user = users.get_current_user()
     url = users.create_login_url(self.request.uri)
     url_linktext = 'Login'
     title= 'Ajouter une entreprise'
     if user:
      raw_id = self.request.get('noteespace')
      id = int(raw_id)
      lesujet = SujetModel.get_by_id(id)
      note  = NoteSujetModel(
             profile  = UserProfileModel.getCurrent(),
             texnote = self.request.get('notebody'),
             sujet = lesujet)
      note.put();
예제 #2
0
 def get(self):
     user = users.get_current_user()
     url = users.create_login_url(self.request.uri)
     url_linktext = 'Login'
     title= 'Ajouter une entreprise'        
     raw_id = self.request.get('id')
     id = int(raw_id)
     lesujet = SujetModel.get_by_id(id)
     emails = EncadreurSujetModel.getAllEmailsBySujetID(id)
     mots = MotcleSujetModel.all().filter('sujet', SujetModel.get_by_id(id))
     notes = NoteSujetModel.all().order('creedate').filter('sujet', SujetModel.get_by_id(id))
     values = {
         'idespace' :id,      
         'notes' : notes,      
         'emails' : emails,
         'mots' : mots, 
         'espace': lesujet,
         'title': title,
         'user': user,
         'url': url,
         'url_linktext': url_linktext,
       }
               
     self.response.out.write(template.render('templates/loadnotesujet.html', values)) 
예제 #3
0
 def get(self):
   user = users.get_current_user()
   url = users.create_login_url(self.request.uri)
   url_linktext = 'Login'
   title= 'Ajouter une entreprise'
               
   if user:
       url = users.create_logout_url(self.request.uri)
       url_linktext = 'Logout'
       espaceid = self.request.get('espaceid')
       raw_id = self.request.get('id')
       id = int(raw_id)
       lesujet = SujetModel.get_by_id(id)
       emails = EncadreurSujetModel.getAllEmailsBySujetID(id)
       notes = NoteSujetModel.all().order('creedate').filter('sujet', SujetModel.get_by_id(id))
       mots = MotcleSujetModel.all().filter('sujet', SujetModel.get_by_id(id))
       userinfo = UserProfileModel.getCurrent()
       candidatures_query = CandidatsModel.all().filter('sujet = ', lesujet)
       candidatures = candidatures_query.fetch(10)
       filedattenteview = list()
       candidaturesview = list()
       affectedto = CandidatureView()
       for c in candidatures:
           candidatureview = CandidatureView()
           candidatureview.etatcandidature = c.etatcandidature
           candidatureview.id = c.key().id_or_name()
           emails = EspaceEmailsModel.getEspaceMembers(c.espace.key().id_or_name())
           usersprofiles = list()
           for email in emails:
               uprofile = UserProfileModel.getProfileByEmail(email)
               if uprofile:
                   usersprofiles.append(uprofile)
                   
           candidatureview.eid = c.espace.key().id()
           candidatureview.up = usersprofiles
           candidatureview.usersemails = emails
           if candidatureview.etatcandidature=="filedattente":
               filedattenteview.append(candidatureview)
           elif candidatureview.etatcandidature=="affecte":
               affectedto = candidatureview
           else:    
               candidaturesview.append(candidatureview) 
       
        
   
   values = {
       'affectedto' : affectedto,
       'filedattenteview' : filedattenteview,
       'candidatures' : candidaturesview ,
       'espaceid' : espaceid,
       'userinfo': userinfo,
       'idsujet' :id,      
       'notes' : notes,
       'mots' : mots,     
       'emails' : emails,
       'sujet': lesujet,
       'title': title,
       'user': user,
       'url': url,
       'url_linktext': url_linktext,
     }
             
   self.response.out.write(template.render('templates/fiche_sujet.html', values))