diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt
index b524c24..4745180 100644
a
|
b
|
a look at how this might be accomplished:
|
499 | 499 | 'book_formset': book_formset, |
500 | 500 | }) |
501 | 501 | |
| 502 | Class-based-views style:: |
| 503 | |
| 504 | from django.views.generic import UpdateView |
| 505 | |
| 506 | class ArticleUpdateView(UpdateView): |
| 507 | """Class-Based View using a FormSet""" |
| 508 | |
| 509 | def post(request): |
| 510 | article_formset = ArticleFormSet(request.POST, request.FILES, prefix='articles') |
| 511 | book_formset = BookFormSet(request.POST, request.FILES, prefix='books') |
| 512 | if article_formset.is_valid() and book_formset.is_valid(): |
| 513 | # do something with the cleaned_data on the formsets. |
| 514 | |
| 515 | def get(request): |
| 516 | article_formset = ArticleFormSet(prefix='articles') |
| 517 | book_formset = BookFormSet(prefix='books') |
| 518 | |
| 519 | def render_to_response(context): |
| 520 | super(ArticleUpdateView, self).render_to_response(request, |
| 521 | 'manage_articles.html', { |
| 522 | 'article_formset': article_formset, |
| 523 | 'book_formset': book_formset, |
| 524 | }) |
| 525 | |
| 526 | |
502 | 527 | You would then render the formsets as normal. It is important to point out |
503 | 528 | that you need to pass ``prefix`` on both the POST and non-POST cases so that |
504 | 529 | it is rendered and processed correctly. |