Example #1
0
def search(req):
    data = fun.warp_data(req.POST)
    keywords = data.get('keywords')
    resume_list = controller.resume_search(keywords)
    return render_to_response('resume_search.html',
                              locals(),
                              context_instance=RequestContext(req))
Example #2
0
def feedback(req):
    if not req.session.get('islogin'):
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    uid = req.session['user_info']['id']
    if req.method == "GET":
        data = fun.warp_data(req.GET)
        return render_to_response('job_feedback.html', data, context_instance = RequestContext(req))
    else:
        data = fun.warp_data(req.POST)
        data['is_read'] = 0
        data['create_date'] = fun.now()
        rt = controller.send_feedback(data)
        if rt:
            msg = '职位回执发送成功!'
        else:
            msg = '职位回执发送失败!'
        return render_to_response('msg.html', locals())
Example #3
0
def search(req):
    if not req.session.get('islogin'):
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    uid = req.session['user_info']['id']
    if req.method != "POST":
        return HttpResponse('unsupport method!')
    keywords = fun.warp_data(req.POST).get('keywords')
    job_list = controller.get_job_search(keywords)
    return render_to_response('job_search.html', locals(), context_instance = RequestContext(req))
Example #4
0
def job(req):
    if not req.session.get('islogin'):
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    uid = req.session['user_info']['id']
    if req.method == "GET":
        data = fun.warp_data(req.GET)
        id = data.get('id')
        job_info = controller.get_job_info(id)
        return render_to_response('job.html', locals(), context_instance = RequestContext(req))
    elif req.method == "POST":
        data = fun.warp_data(req.POST)
        data['uid'] = uid
        rt = controller.post_job_info(data)
        if rt:
            msg = '提交职位信息成功'
        else:
            msg = '提交职位信息失败'
        return render_to_response('msg.html', locals())
Example #5
0
def apply(req):
    if not req.session.get('islogin'):
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    uid = req.session['user_info']['id']
    if req.method != "POST":
        return HttpResponse('unsupport method!')
    data = fun.warp_data(req.POST)
    data['send_uid'] = uid
    rt = controller.job_apply(data)
    return HttpResponse(json.dumps(rt))
Example #6
0
def feedback(req):
    if not req.session.get('islogin'):
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    uid = req.session['user_info']['id']
    if req.method == "GET":
        data = fun.warp_data(req.GET)
        return render_to_response('job_feedback.html',
                                  data,
                                  context_instance=RequestContext(req))
    else:
        data = fun.warp_data(req.POST)
        data['is_read'] = 0
        data['create_date'] = fun.now()
        rt = controller.send_feedback(data)
        if rt:
            msg = '职位回执发送成功!'
        else:
            msg = '职位回执发送失败!'
        return render_to_response('msg.html', locals())
Example #7
0
def apply(req):
    if not req.session.get('islogin'):
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    uid = req.session['user_info']['id']
    if req.method != "POST":
        return HttpResponse('unsupport method!')
    data = fun.warp_data(req.POST)
    data['send_uid'] = uid
    rt = controller.job_apply(data)
    return HttpResponse(json.dumps(rt))
Example #8
0
def job(req):
    if not req.session.get('islogin'):
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    uid = req.session['user_info']['id']
    if req.method == "GET":
        data = fun.warp_data(req.GET)
        id = data.get('id')
        job_info = controller.get_job_info(id)
        return render_to_response('job.html',
                                  locals(),
                                  context_instance=RequestContext(req))
    elif req.method == "POST":
        data = fun.warp_data(req.POST)
        data['uid'] = uid
        rt = controller.post_job_info(data)
        if rt:
            msg = '提交职位信息成功'
        else:
            msg = '提交职位信息失败'
        return render_to_response('msg.html', locals())
Example #9
0
def search(req):
    if not req.session.get('islogin'):
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    uid = req.session['user_info']['id']
    if req.method != "POST":
        return HttpResponse('unsupport method!')
    keywords = fun.warp_data(req.POST).get('keywords')
    job_list = controller.get_job_search(keywords)
    return render_to_response('job_search.html',
                              locals(),
                              context_instance=RequestContext(req))
Example #10
0
def user_register(pars):
    if pars['passwd'] != pars['repasswd']:
        return -1
    # 数据库操作
    condition = fun.warp_data(pars)
    del condition['repasswd']
    condition['create_date'] = fun.now()
    condition['passwd'] = fun.mk_md5(condition['passwd'])
    # print condition
    u = User(**condition)
    u.save()
    if u.name:
        return 1
Example #11
0
def study(req):
    if not req.session.get('islogin'):
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    if req.method != "POST":
        return HttpResponse('unsupport method!')
    data = fun.warp_data(req.POST)
    rt = controller.resume_study(data)
    if rt:
        return HttpResponseRedirect('/resume/default')
    else:
        msg = '提交工作经验失败,请联系管理员!'
        return render_to_response('msg.html', locals())
Example #12
0
def post(req):
    if not req.session.get('islogin'):
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    if req.method != "POST":
        return HttpResponse('unsupport method!')
    data = fun.warp_data(req.POST)
    uid = req.session['user_info']['id']
    data['uid'] = uid
    rt = controller.resume_post(data)
    if rt:
        return HttpResponseRedirect('/resume/default')
    else:
        msg = '提交简历失败,请联系管理员!'
        return render_to_response('msg.html', locals())
Example #13
0
def company(req):
    if not req.session['islogin']:
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    uid = req.session['user_info']['id']
    company_info = controller.get_company_info(uid)
    if req.method == "POST":
        data = fun.warp_data(req.POST)
        if not company_info:  ##插入记录
            data['uid'] = uid
            del data['id']
            r = controller.insert_company(data)
        else:  ##更新
            r = controller.update_company(data)
        return HttpResponseRedirect('/job/company')
    else:
        uf = FileForm()
        if not company_info:
            company_info = {}
        return render_to_response('company.html', locals(), context_instance = RequestContext(req))
Example #14
0
def login(req):
    msg = 'login page'
    if req.method == 'GET':
        msg = '你提交的方式非法!'
        return render_to_response('msg.html', locals())

    data = fun.warp_data(req.POST)
    rt = controller.user_login(data)
    # print rt.id
    if rt:
        req.session['islogin'] = True
        user_info = {}
        user_info['id'] = rt.id
        user_info['name'] = rt.name
        user_info['email'] = rt.email
        req.session['user_info'] = user_info
        return HttpResponseRedirect('/')
    else:
        msg = '用户名或密码错误,登录失败!'
        return render_to_response('msg.html', locals())
Example #15
0
def company(req):
    if not req.session['islogin']:
        msg = '你当前还没有登录,请先登录!'
        return render_to_response('msg.html', locals())
    uid = req.session['user_info']['id']
    company_info = controller.get_company_info(uid)
    if req.method == "POST":
        data = fun.warp_data(req.POST)
        if not company_info:  ##插入记录
            data['uid'] = uid
            del data['id']
            r = controller.insert_company(data)
        else:  ##更新
            r = controller.update_company(data)
        return HttpResponseRedirect('/job/company')
    else:
        uf = FileForm()
        if not company_info:
            company_info = {}
        return render_to_response('company.html',
                                  locals(),
                                  context_instance=RequestContext(req))
Example #16
0
def search(req):
    data = fun.warp_data(req.POST)
    keywords = data.get('keywords')
    resume_list = controller.resume_search(keywords)
    return render_to_response('resume_search.html', locals(), context_instance = RequestContext(req))