本文整理匯總了Python中job.models.Job.start_date方法的典型用法代碼示例。如果您正苦於以下問題:Python Job.start_date方法的具體用法?Python Job.start_date怎麽用?Python Job.start_date使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類job.models.Job
的用法示例。
在下文中一共展示了Job.start_date方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_valid_staff
# 需要導入模塊: from job.models import Job [as 別名]
# 或者: from job.models.Job import start_date [as 別名]
def get_valid_staff(request):
skill = request.GET.get('skill', '')
if not skill:
return HttpResponse('', mimetype="application/json")
start_date = request.GET.get('start', '')
due_date = request.GET.get('due', '')
for format in formats.get_format('DATETIME_INPUT_FORMATS'):
try:
start_date = datetime.strptime(start_date, format)
due_date = datetime.strptime(due_date, format)
except ValueError:
continue
skill = get_object_or_404(Skill, id=skill)
job = Job()
job.type = skill
job.start_date = start_date
job.due_date = due_date
staff = job.get_valid_staff()
staff_list = []
for staff_obj in staff:
staff_list.append((staff_obj.id, staff_obj.username))
json = simplejson.dumps(staff_list)
return HttpResponse(json, mimetype="application/json")