从文档中,验证表单部分显示以下内容:
def some_view(request):
if request.POST:
form = CaptchaTestForm(request.POST)
# Validate the form: the captcha field will automatically
# check the input
if form.is_valid():
human = True
else:
form = CaptchaTestForm()
return render_to_response('template.html',locals())
问题:代码"human = True"意味着什么,它只是一个解释还是一个注释,显示"captcha that human input is True"?
"human = True"
意味着在if
语句中您知道captcha已成功填写。您可以将这一行更改为常规代码以保存表单。