Opened 11 years ago
Closed 11 years ago
#22597 closed Cleanup/optimization (wontfix)
update the inlineformset_factory example to include extra
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.6 |
Severity: | Normal | Keywords: | inlineformset |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
from django.forms.models import inlineformset_factory
BookFormSet = inlineformset_factory(Author, Book)
author = Author.objects.get(name='Mike Royko')
formset = BookFormSet(instance=author)
should have
BookFormSet = inlineformset_factory(Author, Book, extra=0)
as deafult value of extra is 3.
Note:
See TracTickets
for help on using tickets.
Thanks for offering the suggestion, but I don't think there's a problem with the example as it is, and I'm not sure making it more complicated has much benefit either.