Ejemplo n.º 1
0
    def get(self):
        user = users.get_current_user()
        url = users.create_login_url(self.request.uri)
        url_linktext = 'Login'
                    
        if self.hasValidUser():
         if self.isNewUser():
            self.redirect("/login")
         else:
       
            url = users.create_logout_url(self.request.uri)
            url_linktext = 'Logout'
            listdesespaces = EspaceEmailsModel.getMyEspaces()
            companies_query = CompanyModel.all().order('-companydateadded')
            companies = companies_query.fetch(10)
            selection_query = SelectionModel.all()
            selections = selection_query.fetch(10)
       
	
            selectionsview = list()
		
            for company in companies:
                selectionview = SelectionView()
                selectionview.company = company
                selectionview.tags = list()
                companyid = company.key().id_or_name()
	   
            
           
                for espaceid in listdesespaces:
                    newtag = SelectionModel.getAllTagsForCompanyInThisEspace(espaceid,companyid)
                    match = [elt for elt in selectionview.tags if elt == newtag]
                    if not match :

                        selectionview.tags.append(newtag)
            
                selectionsview.append(selectionview)
    
            
            
        
            values = {
                'taggggs' :selectionview.tags,
                'selections' : selectionsview,
                'companies': companies,
	   
           
                'user': user,
                'url': url,
                'url_linktext': url_linktext,
            }
            self.response.out.write(template.render('templates/companies.html', values))
Ejemplo n.º 2
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
        id = self.request.get('id')
        selectionsview = SelectionModel.getSelectionByEspaceID(id)
        
            
            
        
        values = {
            'selections' : selectionsview,
            'id':id,
           
            'user': user,
            'url': url,
            'url_linktext': url_linktext,
        }
        self.response.out.write(template.render('templates/selection.html', values))           
Ejemplo n.º 3
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))           
Ejemplo n.º 4
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))