inlineformset_factory is not documented well like other formset_factories
|Reported by:||wim@…||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
inlineformset_factory is poorly documented.
lists modelform_factory and modelformset_factory, but not inlineformset_factory.
We should probably add something in the line of:
inlineformset_factory(parent_model, model, form=ModelForm, formfield_callback=None, formset=BaseInlineFormSet, fk_name=None, extra=3, can_delete=True, can_order=False, max_num=None, fields=None, exclude=None)
Note that inlineformset_factory uses modelformset_factory() and marks can_delete=True, extra=3. In addition, it uses BaseInlineFormSet by default.
If your model has more than one ForeignKey to the parent_model, you must specify a fk_name.
Change History (5)
Changed 18 months ago by timo
comment:1 Changed 18 months ago by timo
- Has patch set
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
comment:2 Changed 18 months ago by Tim Graham <timograham@…>
- Resolution set to fixed
- Status changed from new to closed