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


Python Activity.set_job_in_all_lead_activities方法代码示例

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


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

示例1: create_activity

# 需要导入模块: from models import Activity [as 别名]
# 或者: from models.Activity import set_job_in_all_lead_activities [as 别名]
def create_activity(activity_type, lead=None, job=None):
	description = None
	lead_key = None
	job_key = None

	if job is not None and job.key is not None:
		job_key = job.key

	if lead is not None and lead.key is not None:
		lead_key = lead.key
	else:
		if job is not None and job.lead is not None:
			lead_key = job.lead


	if activity_type == 'LEAD_SENT':
		description = _build_lead_sent_description(lead.to_json())
	elif activity_type == 'LEAD_READ':
		description = _build_lead_read_description(lead)
	elif activity_type == 'LEAD_CLICKED':
		description = _build_lead_clicked_description(lead)
	elif activity_type == 'LEAD_PENDING_PAYMENT':
		description = _build_lead_pending_payment_description(lead)
	elif activity_type == 'LEAD_CONVERTED':
		description = _build_lead_converted_description(lead)
	elif activity_type == 'JOB_CREATED':
		Activity.set_job_in_all_lead_activities(job)
		description = _build_job_created_description(job)
	elif activity_type == 'JOB_ASSIGNED':
		description = 'The job has been taken by a Flixer'
	elif activity_type == 'JOB_CANCELLED_BY_FLIXER':
		description = 'The job has been cancelled by the flixer'
	elif activity_type == 'JOB_CANCELLED_BY_PROPERTY_OWNER':
		description = 'The job has been cancelled by the property owner'
	elif activity_type == 'JOB_RESCHEDULED':
		description = 'The job has been rescheduled by the property owner'
	elif activity_type == 'JOB_PUBLISHING_STARTED':
		description = 'The job publishing has been started'
	elif activity_type == 'JOB_PUBLISHING_DONE':
		description = 'The job publishing has been done'
	elif activity_type == 'JOB_PUBLISHING_REDO_DONE':
		description = 'The job fixes publishing has been done'
	elif activity_type == 'JOB_REPROVED':
		description = 'The property owner has reproved the job'
	elif activity_type == 'JOB_APPROVED':
		description = 'The property owner has approved the job'
	elif activity_type == 'JOB_PUBLISHED_AT_VALUEGAIA':
		description = 'The job has been published at ValueGaia'
	elif activity_type == 'JOB_FINISHED':
		description = 'The job has been finished'


	if description is not None:
		Activity.create(description, activity_type, lead_key=lead_key, job_key=job_key)

	return True
开发者ID:jesse1983,项目名称:pymay,代码行数:58,代码来源:activity_helper.py


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