Beispiel #1
0
    def post(self):
        user = users.get_current_user()
        if user:
         

         tagname = self.request.get('tags')
         raw_id = self.request.get('id')
         id = int(raw_id)
         lespace = EspaceModel.get_by_id(id)
         
         tag = TagModel(name =tagname , espace = lespace)
         tag.put();
         idlist = self.request.get_all('id[]')
         for idcompany in idlist:
             idc = int(idcompany)
             company = CompanyModel.get_by_id(idc)
             
             selection = SelectionModel(espace = lespace, company = company, tag = tag,
                                        selectedby =users.get_current_user()).put()

         
         values = {
             
            
	    'idlist': idlist,
	    
          }
Beispiel #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'
     listedesespaces = EspaceEmailsModel.getMyEspaces()
     mesespaces = list()
     for espaceid in listedesespaces:
         mesespaces.append(EspaceModel.get_by_id(espaceid))
                 
     if user:
         url = users.create_logout_url(self.request.uri)
         url_linktext = 'Logout'
         monespace = EspaceModel.all().filter('creepar', user)
     values = {
     
         'listdesespaces': listedesespaces,
         'title': title,
         'monespace': mesespaces,
         'user': user,
         'url': url,
         'url_linktext': url_linktext,
       }
               
     self.response.out.write(template.render('templates/espacepros.html', values))           
Beispiel #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'
         raw_id = self.request.get('id')
         id = int(raw_id)
         lespace = EspaceModel.get_by_id(id)
         emails = EspaceEmailsModel.getAllEmailsByEspaceID(id)
         notes = NoteEspaceModel.all().order('-creedate').filter('espace', EspaceModel.get_by_id(id))
         userinfo = UserProfileModel.getCurrent()
         usersemailsinespace = EspaceEmailsModel.getEspaceMembers(id)
         selectionsview = SelectionSujetModel.getSelectionByEspaceID(raw_id)
         selectionsdescontacts = SelectionModel.getSelectionByEspaceID(id)
       
         candidaturesaffectees = CandidatsModel.getCandidaturesInEspaceBystatus(id,'affecte')
         candidaturesfiledattente = CandidatsModel.getCandidaturesInEspaceBystatus(id,'filedattente')
         candidaturesenattente = CandidatsModel.getCandidaturesInEspaceBystatus(id,'en attente')
         candidaturesrefusee = CandidatsModel.getCandidaturesInEspaceBystatus(id,'refusee')
         
     
     values = {
         'candidaturesaffectees' : candidaturesaffectees,
         'candidaturesfiledattente' : candidaturesfiledattente ,
         'candidaturesenattente' : candidaturesenattente ,
         'candidaturesrefusee' :candidaturesrefusee ,
         'selectionsdescontacts' :selectionsdescontacts ,
         'candidaturesrefusee' :candidaturesrefusee ,
         'selections' : selectionsview,
         'emailsinespace': usersemailsinespace,
         'userinfo': userinfo,
         'idespace' :id,      
         'notes' : notes,      
         'emails' : emails,
         'espace': lespace,
         'title': title,
         'user': user,
         'url': url,
         'url_linktext': url_linktext,
       }
               
     self.response.out.write(template.render('templates/espace.html', values))           
Beispiel #4
0
  def getAllTagsForSujetInThisEspace(self,espaceid, companyid):
    espace = EspaceModel.get_by_id(espaceid)
    sujet = SujetModel.get_by_id(companyid)
    selectionsforsujet_query = SelectionSujetModel.all().filter('espace = ',espace).filter('sujet = ',sujet)
    selectionsforsujet = selectionsforsujet_query.fetch(1000)
    tags = list()
    for selection in selectionsforsujet:
      tags.append(selection.tag)

    return tags
Beispiel #5
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)
     lespace = EspaceModel.get_by_id(id)
     emails = EspaceEmailsModel.getAllEmailsByEspaceID(id)
     notes = NoteEspaceModel.all().order('-creedate').filter('espace', EspaceModel.get_by_id(id))
     values = {
         'idespace' :id,      
         'notes' : notes,      
         'emails' : emails,
         'espace': lespace,
         'title': title,
         'user': user,
         'url': url,
         'url_linktext': url_linktext,
       }
               
     self.response.out.write(template.render('templates/loadespace.html', values))  
Beispiel #6
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)
      lespace = EspaceModel.get_by_id(id)
      note  = NoteEspaceModel(
             profile  = UserProfileModel.getCurrent() ,
             texnote = self.request.get('notebody'),
             espace = lespace)
      note.put();
Beispiel #7
0
  def getSelectionByEspaceID(self,eid):
        sujets_query = SujetModel.all().order('-sujetdateadded')
        sujets = sujets_query.fetch(1000)
        espaceid = int(eid)
	espace = EspaceModel.get_by_id(espaceid)
        selectionsview = list()
		
        for sujet in sujets:
            selectionview = SelectionSujetView()
	    selectionview.sujet = sujet
	    sujetid = sujet.key().id_or_name()
            
            selectionview.tags = SelectionSujetModel.getAllTagsForSujetInThisEspace(espaceid,sujetid)
            selectionsview.append(selectionview)

        return selectionsview
Beispiel #8
0
 def post(self):
     user = users.get_current_user()
     if user:
     
      #récupérer le @sujet
      sujetid = self.request.get('sujetid')
      idsujet = int(sujetid)
      lesujet = SujetModel.get_by_id(idsujet)   
      #récupérer l '@espace
      espaceid = self.request.get('espaceid')
      idespace = int(espaceid)
      lespace = EspaceModel.get_by_id(idespace)
      #récupérer la lettre de motivation
      lettredemotivation = self.request.get('lettredemotivation')
      candidature = CandidatsModel(sujet= lesujet, espace = lespace,
                                   postulepar = users.get_current_user(),
                                   etatcandidature = 'en attente',
                                   lettredemotivation = lettredemotivation).put()
Beispiel #9
0
    def get(self):
        user = users.get_current_user()
        url = users.create_login_url(self.request.uri)
        url_linktext = 'Login'
                    
        if user:
            url = users.create_logout_url(self.request.uri)
            url_linktext = 'Logout'
        else:
            self.redirect(users.create_login_url(self.request.uri))
# GQL is similar to SQL
        companies_query = CompanyModel.all().order('-companydateadded')
        companies = companies_query.fetch(10)
        selection_query = SelectionModel.all()
        selections = selection_query.fetch(10)
        id = self.request.get('id')
        espaceid = int(id)
	espace = EspaceModel.get_by_id(espaceid)
        selectionsview = list()
        for company in companies:
            selectionview = SelectionView()
	    selectionview.company = company
            companyid = company.key().id_or_name()
            
            selectionview.tags = SelectionModel.getAllTagsForCompanyInThisEspace(espaceid,companyid)
            selectionsview.append(selectionview)
            
            
        
        values = {
            'selections' : selectionsview,
            'companies': companies,
	    'id':id,
            
            'user': user,
            'url': url,
            'url_linktext': url_linktext,
        }
        self.response.out.write(template.render('templates/loadajax.html', values))           
Beispiel #10
0
    def post(self):
        user = users.get_current_user()
        if user:
         

         tagname = self.request.get('tags')
         listdesespaces = EspaceEmailsModel.getMyEspaces()
         
         tag = TagModel(name =tagname).put();
         
         for idespace in listdesespaces:
             lespace = EspaceModel.get_by_id(idespace)
                
            
             idlist = self.request.get_all('id[]')
             for idcompany in idlist:
                 idc = int(idcompany)
                 company = CompanyModel.get_by_id(idc)
             
                 
             
                 selection = SelectionModel(espace = lespace, company = company, tag = tag,
                                        selectedby =users.get_current_user()).put()
    def get(self):
        user = users.get_current_user()
        url = users.create_login_url(self.request.uri)
        url_linktext = "Login"

        if user:
            url = users.create_logout_url(self.request.uri)
            url_linktext = "Logout"
        else:
            self.redirect(users.create_login_url(self.request.uri))
        # GQL is similar to SQL
        sujets_query = SujetModel.all().order("-sujetdateadded")
        sujets = sujets_query.fetch(10)
        selection_query = SelectionSujetModel.all()
        selections = selection_query.fetch(10)
        id = self.request.get("id")
        espaceid = int(id)
        espace = EspaceModel.get_by_id(espaceid)
        selectionsview = list()
        for sujet in sujets:
            selectionview = SelectionView()
            selectionview.sujet = sujet
            sujetid = sujet.key().id_or_name()

            selectionview.tags = SelectionSujetModel.getAllTagsForSujetInThisEspace(espaceid, sujetid)
            selectionsview.append(selectionview)

        values = {
            "selections": selectionsview,
            "sujets": sujets,
            "id": id,
            "user": user,
            "url": url,
            "url_linktext": url_linktext,
        }
        self.response.out.write(template.render("templates/loadsujet.html", values))