Opened 15 years ago

Closed 15 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.

Change History (1)

comment:1 by James Bennett, 15 years ago

Resolution: invalid
Status: newclosed

render_to_response doesn't require a "request" parameter.

Note: See TracTickets for help on using tickets.
Back to Top