Пример #1
0
 def post(self, job_id):
     page = self.request.get("page")
     if job_id[0] == "/":
         job_id = job_id[1:]
     job = dbmodels.getJob(job_id)
     if not job:
         # some error handling here
         self.redirect("/jobc")
     if not page:
         logging.error(self.request.arguments())
         logging.error("jobf " + self.request.get("jobfunction"))
         job.location = self.request.get("location")
         job.title = self.request.get("title")
         # sdate = job.sdate
         # edate = job.edate
         job.function = self.request.get("jobfunction")
         job.dayinoffice = self.request.get("jd")
         job.jlove = self.request.get("jlove")
         job.jhate = self.request.get("jhate")
         job.posted_by_text = self.request.get("postas")
         # logging.error("postas " + self.request.get("postas"))
         dbmodels.setJob(jobkey=job.jobkey, job=job)
         dbmodels.addJob2FunctionList(function=job.function, jobkey=job.jobkey)
         job.put()
         url = "/jobc/realjd/_edit/" + job_id + "?page=1"
         # logging.error("url: " + url)
         self.redirect(url)
     elif page == "1":
         job.work_opportunity = self.request.get("wop")
         job.work_culture = self.request.get("wc")
         job.salary_growth = self.request.get("wsg")
         job.work_life_balance = self.request.get("wlb")
         job.fixed_salary = self.request.get("fsalary")
         # job.yearly_bonus = self.request.get("ybonus")
         # job.joining_bonus = self.request.get("jbonus")
         job.variable_salary = self.request.get("vsalary")
         job.stock = self.request.get("stock")
         job.alum_base = self.request.get("abase")
         job.interview_question = self.request.get("iq")
         job.interview_process = self.request.get("ip")
         job.cvpoint = self.request.get("cvpoint")
         job.exit_option = self.request.get("eo")
         dbmodels.setJob(jobkey=job.jobkey, job=job)
         job.put()
         url = "/jobc/realjd/" + job_id
         logging.error("url: " + url)
         self.redirect(url)
     else:
         # some error handling here
         # either redirect to first page
         self.redirect("/jobc")
Пример #2
0
def jobbycompany(jobids):
    jobbycompany = {}
    i = 0
    for jid in jobids:
        job = dbmodels.getJob(jid)
        company = dbmodels.getCompany(job.company_id)
        companyname = company.company_name
        jobtitle = job.title
        if not companyname in jobbycompany:
            jobbycompany[companyname] = {}
        jobbycompany[companyname][i] = {}
        jobbycompany[companyname][i]["jobtitle"] = jobtitle
        jobbycompany[companyname][i]["joburl"] = "/jobc/realjd/" + jid
    return jobbycompany
Пример #3
0
    def get(self, job_id):
        page = self.request.get("page")
        if job_id[0] == "/":
            job_id = job_id[1:]
        job = dbmodels.getJob(job_id)
        author = dbmodels.getPerson(job.person_linkedin_id)
        if not job:
            # throw some error
            self.redirect("/jobc")

        cookie_value = self.request.cookies.get(USERID_COOKIE)
        person = getUserFromCookie(cookie_value)
        params = setRealJDContent(job)
        params["user"] = ""
        if (
            person and author and person.linkedin_id == author.linkedin_id
        ):  # show edit link when author is the logged in user
            params["user"] = person.fname
        self.response.out.write(render_str("onejd.html", **params))
Пример #4
0
    def get(self, job_id):
        page = self.request.get("page")
        if job_id[0] == "/":
            job_id = job_id[1:]
        job = dbmodels.getJob(job_id)

        if not job:
            # some error here
            self.redirect("/jobc")

        author = dbmodels.getPerson(job.person_linkedin_id)
        cookie_value = self.request.cookies.get(USERID_COOKIE)
        person = getUserFromCookie(cookie_value)

        fullname = author.fname

        if (
            not author or not person or not person.linkedin_id == author.linkedin_id
        ):  # allow edit when author is the logged in user
            user = ""
            if person:
                user = person.fname
            self.response.out.write(render_str("authorlogin.html", user=user, author=fullname))
            return

        if not page:
            school = author.keyschool.schoolname
            location = author.location
            title = job.title
            logging.error("companyid")
            logging.error(job.company_id)
            company = dbmodels.getCompany(job.company_id).company_name
            sdate = job.sdate
            authorcheck = job.posted_by_text
            if authorcheck == "" or authorcheck.startswith("Alumnus"):
                authorcheck = "alum"
            logging.error("authorcheck " + authorcheck)
            if sdate:
                sdate = job.sdate.strftime("%m/%Y")
            edate = job.edate.strftime("%m/%Y")
            jd = job.dayinoffice
            jlove = job.jlove
            jhate = job.jhate
            jfunction = job.function
            self.response.out.write(
                render_str(
                    "jd.html",
                    user=fullname,
                    authorcheck=authorcheck,
                    schoolname=school,
                    oneself=fullname,
                    location=location,
                    school=school,
                    title=title,
                    company=company,
                    sdate=sdate,
                    edate=edate,
                    jhate=jhate,
                    jlove=jlove,
                    jd=jd,
                    jfunction=jfunction,
                )
            )
        elif page == "1":
            iq = job.interview_question
            ip = job.interview_process
            cvpoint = job.cvpoint
            eo = job.exit_option
            alum_base = job.alum_base
            stock = job.stock
            vsalary = job.variable_salary
            wop = job.work_opportunity
            wc = job.work_culture
            wsg = job.salary_growth
            wlb = job.work_life_balance
            fixed_salary = job.fixed_salary
            # logging.error("work culter = " + wc)
            self.response.out.write(
                render_str(
                    "jd2.html",
                    user=fullname,
                    wopcheck=wop,
                    iq=iq,
                    eo=eo,
                    abasecheck=alum_base,
                    wccheck=wc,
                    wsgcheck=wsg,
                    stockcheck=stock,
                    wlbcheck=wlb,
                    fsalary=fixed_salary,
                    ip=ip,
                    cvpoint=cvpoint,
                )
            )