Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#19640 closed Cleanup/optimization (fixed)

inlineformset_factory is not documented well like other formset_factories

Reported by: wim@… Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords: inlineformset_factory documentation
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

inlineformset_factory is poorly documented.

https://docs.djangoproject.com/en/dev/ref/forms/models/#django.forms.models.modelformset_factory
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.

Attachments (1)

19640.diff (1.9 KB ) - added by Tim Graham 11 years ago.

Download all attachments as: .zip

Change History (5)

by Tim Graham, 11 years ago

Attachment: 19640.diff added

comment:1 by Tim Graham, 11 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

comment:2 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 5b2d9bacd2512bcdf371c05b0b43bc713dcca080:

Fixed #19640 - Added inlineformset_factory to reference docs.

Thanks wim@ for the suggestion.

comment:3 by Tim Graham <timograham@…>, 11 years ago

In 34718395edec9aaf01443b7c9d89ebe14400721e:

[1.5.x] Fixed #19640 - Added inlineformset_factory to reference docs.

Thanks wim@ for the suggestion.

Backport of 5b2d9bacd2 from master

comment:4 by Tim Graham <timograham@…>, 11 years ago

In 34718395edec9aaf01443b7c9d89ebe14400721e:

[1.5.x] Fixed #19640 - Added inlineformset_factory to reference docs.

Thanks wim@ for the suggestion.

Backport of 5b2d9bacd2 from master

Note: See TracTickets for help on using tickets.
Back to Top