#19640 closed Cleanup/optimization (fixed)
inlineformset_factory is not documented well like other formset_factories
| Reported by: | 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)
Change History (5)
by , 13 years ago
| Attachment: | 19640.diff added |
|---|
comment:1 by , 13 years ago
| Has patch: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
In 5b2d9bacd2512bcdf371c05b0b43bc713dcca080: