本文整理汇总了Python中Contest.models.Contest.contestName_f方法的典型用法代码示例。如果您正苦于以下问题:Python Contest.contestName_f方法的具体用法?Python Contest.contestName_f怎么用?Python Contest.contestName_f使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contest.models.Contest
的用法示例。
在下文中一共展示了Contest.contestName_f方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: holdContest
# 需要导入模块: from Contest.models import Contest [as 别名]
# 或者: from Contest.models.Contest import contestName_f [as 别名]
def holdContest(request):
f=HoldContestForm()
dc = {'form':f}
context = RequestContext(request, dc)
if request.method == "POST":
f=HoldContestForm(request.POST)
if not f.is_valid():
dc = {'form':f}
context = RequestContext(request, dc)
#raise Http404
return render_to_response('holdContest.html',context)
else:
contest=Contest()
context = RequestContext(request,dc)
# contest.adminID = User.objects.filter(User.username="sen3")[0]
contest.contestName_f = f.cleaned_data['contestName']
contest.contestpwd_f = f.cleaned_data['contestpwd']
contest.termsCond = f.cleaned_data['termsCond']
contest.contestFromDate = f.cleaned_data['contestFromDate']
contest.contestToDate = f.cleaned_data['contestToDate']
contest.contestFromTime = f.cleaned_data['contestFromTime']
contest.contestToTime = f.cleaned_data['contestToTime']
#contest.isApproved = False
contest.save()
f=HoldContestForm()
#contestID = contest.contestID
return HttpResponse("Your contest is send to admin for approval%s"%request.path)
else:
return render_to_response('holdContest.html',context)