Opened 8 years ago

Closed 8 years ago

#20107 closed Uncategorized (invalid)

Error in example for "Using initial data with a formset"

Reported by: anteater_sa Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


In the docs the initial dict is wrapped in a list which causes an error in Django 1.5, should be:

>>> ArticleFormSet = formset_factory(ArticleForm, extra=2)
>>> formset = ArticleFormSet(initial={
...     'title': u'Django is now open source',
...     'pub_date':,
... })

Change History (1)

comment:1 Changed 8 years ago by Simon Charette

Resolution: invalid
Status: newclosed

When passing initial data to a FormSet instance it's expected to be a list of dicts in order to specify initial data for individual forms.

Form on the other hand accept initial as a dict.

See TicketClosingReasons/UseSupportChannels for more details.

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