diff options
| author | Florian Apolloner <apollo13@apolloner.eu> | 2012-07-25 13:33:33 -0700 |
|---|---|---|
| committer | Florian Apolloner <apollo13@apolloner.eu> | 2012-07-25 13:33:33 -0700 |
| commit | 498bf5c26cfba5e4c452501c82cfa8501cfc7d96 (patch) | |
| tree | 3a50cc518df4f45bf93a485fd107ee5bec00b3bf | |
| parent | c2ff027861dcbdd0c6ac82eb6e7f74455499c4e6 (diff) | |
| parent | c6d06a9453859c5520312454b6353498332ff838 (diff) | |
Merge pull request #212 from kevinlondon/ticket_18614_1_4
[1.4] Ticket 18614 -- Add Imports and change render_to_response to render
| -rw-r--r-- | docs/topics/forms/index.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt index 18e55f5eb6..862ce31992 100644 --- a/docs/topics/forms/index.txt +++ b/docs/topics/forms/index.txt @@ -89,6 +89,9 @@ The standard pattern for processing a form in a view looks like this: .. code-block:: python + from django.shortcuts import render + from django.http import HttpResponseRedirect + def contact(request): if request.method == 'POST': # If the form has been submitted... form = ContactForm(request.POST) # A form bound to the POST data @@ -99,7 +102,7 @@ The standard pattern for processing a form in a view looks like this: else: form = ContactForm() # An unbound form - return render_to_response('contact.html', { + return render(request, 'contact.html', { 'form': form, }) |
