Opened 16 years ago
Closed 16 years ago
#10158 closed (invalid)
error in forms docs
Reported by: | turadg | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
on this page,
http://docs.djangoproject.com/en/dev/topics/forms/?from=olddocs
there is a function shown,
def contact(request):
if request.method == 'POST': # If the form has been submitted...
form = ContactForm(request.POST) # A form bound to the POST data
if form.is_valid(): # All validation rules pass
# Process the data in form.cleaned_data
# ...
return HttpResponseRedirect('/thanks/') # Redirect after POST
else:
form = ContactForm() # An unbound form
return render_to_response('contact.html', {
'form': form,
})
the render_to_response method is missing the 'request' parameter.
also, I implore you to allow users to comment like the PHP docs do.
render_to_response
doesn't require a "request" parameter.