Opened 12 years ago

Closed 12 years ago

#18832 closed Bug (fixed)

The example for excluding field from forms uses the wrong field.

Reported by: Ned Batchelder Owned by: nickmartini
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In this section: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form

The first paragraph shows excluding the birth_date field from the form. Then the Note shows how to be sure the field is available when the model is saved, but the examples there provide title, not birth_date. The examples should be fixed to deal with the same excluded field.

Change History (4)

comment:1 by Claude Paroz, 12 years ago

Triage Stage: UnreviewedAccepted

comment:2 by nickmartini, 12 years ago

Owner: changed from nobody to nickmartini

comment:3 by nickmartini, 12 years ago

Has patch: set

I noticed that in the example code in the docs, a non-required field (birth date) was excluded, and then the required 'title' field was manually added to the form even though it had not been excluded. I chose to exclude the required field 'title' instead, leaving it manually added in the example.

https://github.com/django/django/pull/359

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

Resolution: fixed
Status: newclosed

In [76bd33539f8a188c4b1770babe6d2b55e5030c68]:

Merge pull request #359 from nmartini/ticket_18832

Fixed #18832 - Updated ModelForm example fields to match note below

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