def get(self): session = Session() viewer = session["empl"] emplid = self.request.get('emplid') employee = Employee.get_by_id(int(emplid)) if viewer.key().id == employee.key().id: skill = Skill.get_by_id(int(self.request.get('skillid'))) skillempl = employee.employeeskills_set.filter('skill = ', skill.key()).get() skillempl.delete() link = "/profilepage?emplid=" + emplid self.redirect(link) else: self.redirect("/nouser")
def get(self): session = Session() employee = Employee.get_by_id(int(self.request.get('emplid'))) skills = [Anon(skill=es.skill,exp=es.yearsxper) for es in employee.employeeskills_set] noskills = len(skills) allskills = Skill.all() viewer = session["empl"] if viewer.key().id == employee.key().id: owner = True else: owner = False vals = {'employee' : employee, 'skills' : skills, 'noskills' : noskills, 'allskills' : allskills, 'owner' : owner, 'url' : session["url"]} self.render_response("profilePage.html", **vals)
def post(self): session = Session() employee = Employee.get_by_id(int(self.request.get('employeeId'))) viewer = session["empl"] if viewer.key().id == employee.key().id: owner = True else: owner = False if owner: skilll = Skill.get_by_id(int(self.request.get('skillId'))) years = str(self.request.get('skillExperience')) emplskill = EmployeeSkills(skill=skilll, empl=employee, yearsxper=years) emplskill.put() link = "/profilepage?emplid=" + str(self.request.get('employeeId')) self.redirect(link) else: self.redirect("/nouser")