﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
10403	provide declarative syntax to define FormSets - including ModelFormSet and InlineFormSet	Koen Biermans <koen.biermans@…>	Anthony Addae	"Provide a declarative mechanism to define modelformsets or inlineformsets.

The attached patch allows definitions like this:

{{{
class AuthorForm(forms.ModelForm):
    class Meta:
        model = Author

class DeclarativeAuthorFormSet(forms.models.ModelFormSet):
    form = AuthorForm
    model = Author
    extra = 3
}}}

and

{{{
class BookForm(forms.ModelForm):
    class Meta:
        model = Book

class DeclarativeAuthorBooksFormSet(forms.models.InlineFormSet):
    model = Book
    form = BookForm
    parent = 'author'

}}}

An advantage is that the defined form is directly used as the form class in the formset, not as a base class for a new form class (what inlineformset_factory does). This way specific field definitions and other customisations in the form work like they should so you don't need to redefine things in __init__().

"	New feature	assigned	Forms	dev	Normal		formset modelformset inlineformset		Accepted	1	0	0	1	0	0
