コード例 #1
0
ファイル: admin.py プロジェクト: xdai555/learn-python
def enter_interview_process(modeladmin, request, queryset):
    candidate_names = ""
    for  resume in queryset:
        # 把对象属性全部赋值到另外的对象中
        candidate = Candidate()
        candidate.__dict__.update(resume.__dict__)
        candidate.created_date = datetime.now()
        candidate.creator = request.user.username
        candidate.save()
    messages.add_message(request, messages.INFO, "已经进入面试环节")
コード例 #2
0
def enter_interview_process(model_admin, request, queryset):
    candidate_names = ""
    for resume in queryset:
        candidate = Candidate()
        # 将 resume 中所有属性拷贝到 candidate 对象中去,由于复制了 ID 所以会覆盖已有ID到的角色
        candidate.__dict__.update(resume.__dict__)
        candidate_names = candidate.username + "," + candidate_names
        candidate.creator = request.user.username
        candidate.save()
    messages.add_message(request, messages.INFO,
                         '候选人:%s 已经进入面试流程' % candidate_names)
コード例 #3
0
ファイル: admin.py プロジェクト: notluckydog/recruitment
def enter_interview_process(modeladmin, request, queryset):
    candidate_names = ""
    for resume in queryset:
        candidate = Candidate()
        # 把 obj 对象中的所有属性拷贝到 candidate 对象中:
        candidate.__dict__.update(resume.__dict__)
        candidate.created_date = datetime.now()
        candidate.modified_date = datetime.now()
        candidate_names = candidate.username + "," + candidate_names
        candidate.creator = request.user.username
        candidate.save()
    messages.add_message(request, messages.INFO, '候选人: %s 已成功进入面试流程' % (candidate_names) )
コード例 #4
0
def enter_interview_process(model_admin, request, queryset):
    """
    将简历添加到招聘内容中,激活面试流程
    """
    candidate_names = []
    for resume in queryset:
        candidate = Candidate()
        # 把 obj 对象中的所有属性拷贝到 candidate 对象中:
        candidate.__dict__.update(resume.__dict__)
        candidate.created_date = timezone.now()
        candidate.modified_date = timezone.now()
        candidate_names.append(candidate.username)
        candidate.creator = request.user.username
        candidate.save()
    messages.add_message(
        request=request,
        level=messages.INFO,
        message='候选人: %s 已成功进入面试流程' % ('、'.join(candidate_names)),
    )
コード例 #5
0
def enter_interview_process(modeladmin, request, queryset):
    '''
    勾选候选人简历,进入面试
    :param modeladmin:
    :param request:
    :param queryset:
    :return:
    '''
    candidate_names = ""
    for resume in queryset:
        candidate = Candidate()
        # 把obj中所有对应属性,拷贝到candidate对象中
        candidate.__dict__.update(resume.__dict__)
        candidate.created_date = datetime.now()
        candidate.modified_date = datetime.now()
        candidate_names += candidate.username + ","
        candidate.creator = request.user.username
        candidate.save()
    messages.add_message(request, messages.INFO,
                         '候选人:%s已成功进入面试流程' % candidate_names)