diff options
Diffstat (limited to 'docs/topics/forms/formsets.txt')
| -rw-r--r-- | docs/topics/forms/formsets.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt index 3e28e3fec7..5620693582 100644 --- a/docs/topics/forms/formsets.txt +++ b/docs/topics/forms/formsets.txt @@ -582,7 +582,7 @@ The only thing you will want to be aware of is making sure to use the management form inside the template. Let's look at a sample view:: from django.forms import formset_factory - from django.shortcuts import render_to_response + from django.shortcuts import render from myapp.forms import ArticleForm def manage_articles(request): @@ -594,7 +594,7 @@ management form inside the template. Let's look at a sample view:: pass else: formset = ArticleFormSet() - return render_to_response('manage_articles.html', {'formset': formset}) + return render(request, 'manage_articles.html', {'formset': formset}) The ``manage_articles.html`` template might look like this: @@ -659,7 +659,7 @@ more than one formset to be sent to a view without name clashing. Lets take a look at how this might be accomplished:: from django.forms import formset_factory - from django.shortcuts import render_to_response + from django.shortcuts import render from myapp.forms import ArticleForm, BookForm def manage_articles(request): @@ -674,7 +674,7 @@ a look at how this might be accomplished:: else: article_formset = ArticleFormSet(prefix='articles') book_formset = BookFormSet(prefix='books') - return render_to_response('manage_articles.html', { + return render(request, 'manage_articles.html', { 'article_formset': article_formset, 'book_formset': book_formset, }) |
