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 , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 12 years ago
Owner: | changed from | to
---|
comment:3 by , 12 years ago
Has patch: | set |
---|
comment:4 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
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