Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14307 closed (fixed)

Document form ChoiceField tuple

Reported by: Adam Vandenberg Owned by: nobody
Component: Documentation Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

Mention that the 2-tuples are (value, display), same as choices in models.

Attachments (1)

choice-tuple.diff (599 bytes) - added by Adam Vandenberg 6 years ago.

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by Adam Vandenberg

Attachment: choice-tuple.diff added

comment:1 Changed 6 years ago by asenchi

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 6 years ago by Jannis Leidel

Triage Stage: Design decision neededAccepted

comment:3 Changed 6 years ago by anonymous

Triage Stage: AcceptedReady for checkin

comment:4 Changed 6 years ago by Russell Keith-Magee

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

This is a good start, but isn't quite right. ChoicesField.choices isn't require to just be tuples; it can also be a nested structure. The documentation for the model Field.choices details this; it would be better to reference the model docs for a full description of what is possible.

Interestingly, the documentation *did* include such a reference when the nested groups feature was introduced in [7996]; it must have been lost in a refactor along the way.

comment:5 Changed 6 years ago by Gabriel Hurley

Resolution: fixed
Status: newclosed

(In [14231]) Fixed #14307 -- Linked ChoiceField.choices docs to Field.choices docs to explain the formatting options available. Thanks to adamv for the report and Russ for the suggested fix.

comment:6 Changed 6 years ago by Gabriel Hurley

(In [14232]) [1.2.X] Fixed #14307 -- Linked ChoiceField.choices docs to Field.choices docs to explain the formatting options available. Thanks to adamv for the report and Russ for the suggested fix.

Backport of [14231] from trunk.

comment:7 Changed 6 years ago by Adam Vandenberg

Resolution: fixed
Status: closedreopened

I am not an expert in reST or Sphinx by any means, but the link appears to be linking wrong, going form here: http://docs.djangoproject.com/en/dev/ref/forms/fields/#choicefield to here: http://docs.djangoproject.com/en/dev/ref/forms/models/fields/#choices instead of here: http://docs.djangoproject.com/en/dev/ref/models/fields/#choices

comment:8 Changed 6 years ago by Gabriel Hurley

Resolution: fixed
Status: reopenedclosed

(In [14234]) Fixed #14307 -- Added a new crossref target to model field reference docs and fixed broken relative link in form field reference docs. Thanks to adamv for the report.

comment:9 Changed 6 years ago by Gabriel Hurley

(In [14235]) [1.2.X] Fixed #14307 -- Added a new crossref target to model field reference docs and fixed broken relative link in form field reference docs. Thanks to adamv for the report.

Backport of [14234] from trunk.

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