[Fixed]-Django formset – surplus line is rendered in the table

1👍

According to the Django docs:

As you can see it only displayed one empty form. The number of empty forms that is displayed is controlled by the extra parameter. By default, formset_factory() defines one extra form; the following example will display two blank forms:

With that in mind, Django docs suggests doing something like this to set the number of extra forms:

ArticleFormSet = formset_factory(ArticleForm, extra=2)

👤KhoPhi

Leave a comment