当前位置: 首页>>代码示例>>Python>>正文


Python Job.type方法代码示例

本文整理汇总了Python中models.Job.type方法的典型用法代码示例。如果您正苦于以下问题:Python Job.type方法的具体用法?Python Job.type怎么用?Python Job.type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Job的用法示例。


在下文中一共展示了Job.type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: elmcafiolo_PostJob

# 需要导入模块: from models import Job [as 别名]
# 或者: from models.Job import type [as 别名]
def elmcafiolo_PostJob(request):
    jsonData = json.loads(request.body)

    try:
        preset = Preset.objects.get(name=jsonData['job']['preset'])
    except ObjectDoesNotExist:
        status = http_NOT_FOUND
        return HttpResponse(json.dumps({'message': 'Preset not found'}), status=status, content_type='application/json')

    job = Job()
    job.name                = jsonData['job']['name']
    job.input_filename      = jsonData['job']['input_filename']
    job.input_path          = jsonData['job']['input_path']
    job.basename            = jsonData['job']['basename']
    job.preset              = preset
    job.priority            = jsonData['job']['priority']
    job.output_path         = jsonData['job']['output_path']
    job.status              = 'U' # Unassigned
    job.type                = preset.type

    job.save()

    response = {"job": {"id": job.id, "name": job.name}}
    #
    # La unica respuesta para esto es OK

    status = http_POST_OK
    return HttpResponse(json.dumps(response), status=status, content_type='application/json')
开发者ID:emilianobilli,项目名称:tarecho,代码行数:30,代码来源:views.py

示例2: getJobInfo

# 需要导入模块: from models import Job [as 别名]
# 或者: from models.Job import type [as 别名]
def getJobInfo(dom, company):
    '''获取一个职位的招聘信息'''

    job_info = {}
    type_tr = dom('.jobInfoItems tr:eq(0)')
    trtext = type_tr.text()
    trtext = trtext.split(u':') if trtext else []
    if len(trtext) == 2:
        k, v = trtext
        v = v.replace('/', ',')
        job_info[k] = v

    trs = dom('.jobInfoItems tr:gt(1)')
    for tr in trs:
        tr = pq(tr)
        tds = tr('td')
        for td in tds:
            td = pq(td)
            tdtext = td.text().split(u':')
            if len(tdtext) == 2:
                k, v = tdtext
                job_info[k] = v
    
    salary = job_info.get(u'职位月薪')
    if salary:
        sh = re.search(r'(\d+)-(\d+)', salary)
        salary = sh.groups() if sh else (None, None)
    else:
        salary = (None, None)
    quantity = job_info.get(u'招聘人数')
    if quantity:
        sh = re.search(r'(\d+)', quantity)
        quantity = sh.group(0) if sh else None

    job = Job()
    occ_type = job_info.get(u'职位类别')
    occ = Occupational.query.filter(Occupational.type==occ_type).first()
    if not occ:
        occ = Occupational()
        occ.name = 'FILL'
        occ.type = occ_type
        db.session.add(occ)
    job.occupational = occ
    job.type = job_info.get(u'工作性质')
    job.exp = job_info.get(u'工作经验')
    job.manage_exp = job_info.get(u'管理经验')
    job.quantity = quantity
    job.degree = job_info.get(u'最低学历')
    job.salary_low, job.salary_high = salary
    job.description = dom('.jobDes').html()
    job.etag = ''

    return job
开发者ID:Genieliu,项目名称:job-hunter,代码行数:55,代码来源:job_spider.py


注:本文中的models.Job.type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。