Opened 9 years ago

Closed 9 years ago

#11755 closed (fixed)

Django documentation on Model FormSets should include a tip on how to override default behavior

Reported by: ffualo Owned by: nobody
Component: Documentation Version: 1.1
Severity: Keywords: modelformset_factory
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The documentation page "Creating forms from models" mentions:

"By default, when you create a formset from a model, the formset will use a queryset that includes all objects in the model (e.g., Author.objects.all()). You can override this behavior by using the queryset argument"

However, it does not mention how to override this behavior, which is useful when you want to print blank form fields in a template. This is done with


This issue was discussed on #django.

Attachments (1)

modelforms_change.diff (676 bytes) - added by ffualo 9 years ago.
A recommended documentation addition

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by ffualo

Attachment: modelforms_change.diff added

A recommended documentation addition

comment:1 Changed 9 years ago by Alex Gaynor

Triage Stage: UnreviewedReady for checkin

comment:2 Changed 9 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [11549]) Fixed #11755 -- Added documentation for an edge case of FormSet usage. Thanks to ffualo for the suggestion.

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