本文整理汇总了Python中forms.ProjectForm.rfp方法的典型用法代码示例。如果您正苦于以下问题:Python ProjectForm.rfp方法的具体用法?Python ProjectForm.rfp怎么用?Python ProjectForm.rfp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类forms.ProjectForm
的用法示例。
在下文中一共展示了ProjectForm.rfp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_project
# 需要导入模块: from forms import ProjectForm [as 别名]
# 或者: from forms.ProjectForm import rfp [as 别名]
def create_project(request, rfpId):
context = RequestContext(request)
user = request.user
progress_status = 30
rfp = RfpCampaign.objects.get(pk=rfpId)
print("RFP is: ")
print(rfp)
questions = rfp.get_project_questions()
if request.method == "POST":
print(request.POST)
project = ProjectForm(request.POST, request.FILES, questions=questions)
if project.is_valid():
project = Project(**project.cleaned_data)
project.rfp = rfp
project.user = user
project.save()
if "Next" in request.POST:
return HttpResponseRedirect(reverse("create_project_budget", args=[project.pk]))
else:
return HttpResponseRedirect(reverse("create_project_previous", args=[project.pk]))
else:
project = ProjectForm(questions=questions)
return render_to_response(
"rfp/create_project.html",
{"form": project, "user": user, "progress_status": progress_status, "rfp": rfp},
context,
)