def get(self): Guser = users.get_current_user() if Guser: vstrUsername = Guser.nickname() vstrLogoutURL = users.create_logout_url(dest_url="/") findRequest = Tasks.query(Tasks.strToReference == Guser.user_id()) TaskList = findRequest.fetch() vstrTotalTasks = len(TaskList) template = template_env.get_template('templates/dynamic/navigation/header.html') context = {'vstrUsername': vstrUsername, 'vstrLogoutURL': vstrLogoutURL, 'TaskList':TaskList,'vstrTotalTasks':vstrTotalTasks} self.response.write(template.render(context)) else: vstrLoginURL = users.create_login_url(dest_url="/") template = template_env.get_template('templates/dynamic/navigation/header.html') context = {'vstrLoginURL': vstrLoginURL} self.response.write(template.render(context))
def get(self): Guser = users.get_current_user() if Guser: logging.info("Employee Profiles") findRequest = Activity.query(Activity.strReference == Guser.user_id()) thisActivityList = findRequest.fetch() findRequest = EmploymentDetails.query(EmploymentDetails.strReference == Guser.user_id()) thisEmployeeList = findRequest.fetch() if len(thisEmployeeList) > 0: thisEmployee = thisEmployeeList[0] else: thisEmployee = EmploymentDetails() findRequest = Tasks.query(Tasks.strToReference == Guser.user_id()) thisTasksList = findRequest.fetch() TotalTasks = len(thisTasksList) findRequest = UserRights.query(UserRights.strReference == Guser.user_id()) thisUserRightsList = findRequest.fetch() if len(thisUserRightsList) > 0: thisUserRights = thisUserRightsList[0] else: thisUserRights = UserRights() if thisUserRights.bolIsEmployee: template = template_env.get_template('templates/dynamic/employee/Profile.html') context = {'thisActivityList':thisActivityList,'thisEmployee':thisEmployee,'TotalTasks': TotalTasks} self.response.write(template.render(context)) else: template = template_env.get_template('templates/500.html') context = {} self.response.write(template.render(context))