It looks like there is a somewhat relevant piece of information missing from this section. It leaves out the fact that you also must specify which formset to use when creating your inlineformset in the view:

Currently:

"See Overriding clean() on a ModelFormSet, but subclass BaseInlineFormSet rather than BaseModelFormSet."

Suggestion:

"See Overriding clean() on a ModelFormSet, but subclass BaseInlineFormSet rather than BaseModelFormSet. You must also specify which formset to use when creating your inlineformset in your view:"

Change History (12)

Overriding clean() on an InlineFormSet →
Add an example of the formset argument for inlineformset_factory

Triage Stage:

Unreviewed →
Accepted

Type:

Uncategorized →
Cleanup/optimization

There's an example for modelformset_factory that uses the formset argument and while you might be able to infer a similar technique will work for inlineformset_factory since the docs say "Inline formsets is a small abstraction layer on top of model formsets", I agree an example could be helpful. I'm not sure it should be specific to the "Overriding clean()" section though, since the formset argument is useful for other cases as well.

If you could offer a patch, I'll be happy to review and commit it. Thanks!

I've marked this ticket as especially suitable for first-time committers or people following the ​Don't be afraid to commit tutorial. If you're tackling this ticket, please don't hesitate to ask me for guidance if you'd like any, either here or on the Django IRC channels, where I can be found as EvilDMP.