Ticket #14897: formset-examples.diff

File formset-examples.diff, 1.0 KB (added by Marcus Fredriksson, 13 years ago)
  • docs/topics/forms/formsets.txt

    diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt
    index fae76c7..db53fc2 100644
    a b management form inside the template. Let's look at a sample view:  
    381381            formset = ArticleFormSet(request.POST, request.FILES)
    382382            if formset.is_valid():
    383383                # do something with the formset.cleaned_data
     384                pass
    384385        else:
    385386            formset = ArticleFormSet()
    386387        return render_to_response('manage_articles.html', {'formset': formset})
    a look at how this might be accomplished:  
    430431            book_formset = BookFormSet(request.POST, request.FILES, prefix='books')
    431432            if article_formset.is_valid() and book_formset.is_valid():
    432433                # do something with the cleaned_data on the formsets.
     434                pass
    433435        else:
    434436            article_formset = ArticleFormSet(prefix='articles')
    435437            book_formset = BookFormSet(prefix='books')
Back to Top