本文整理汇总了Python中models.Job.start_packaging方法的典型用法代码示例。如果您正苦于以下问题:Python Job.start_packaging方法的具体用法?Python Job.start_packaging怎么用?Python Job.start_packaging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Job
的用法示例。
在下文中一共展示了Job.start_packaging方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_medias
# 需要导入模块: from models import Job [as 别名]
# 或者: from models.Job import start_packaging [as 别名]
def process_medias():
# find the job which is being processed
job_id = request.form['job_id']
job = _get_job(job_id)
pprint.pprint('========= BACKGROUND PROCESSING ')
# gets the watermark image
watermark = ih.get_watermark_image()
photo_list = []
# iterates over each photo
for p in job.medias['photos']:
new_url = _process_media(p, watermark, job_id)
photo_list.append({
'title': p['title'],
'url': new_url,
'media_id': p['media_id']
})
job.medias['photos'] = photo_list
if job.status == 'ASSIGNED':
# send a message to property owner telling him that his job is ready for approval
_enqueue_job_in_approval_message(job)
create_activity('JOB_PUBLISHING_DONE', job=job)
elif job.status == 'REDO':
_enqueue_job_back_from_redo_message(job)
create_activity('JOB_PUBLISHING_REDO_DONE', job=job)
job.status = 'REVIEW'
job.put()
Job.start_packaging(job_id)
return '', 200