Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#14307 closed (fixed)

Document form ChoiceField tuple

Reported by: adamv 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 adamv 4 years ago.

Download all attachments as: .zip

Change History (10)

Changed 4 years ago by adamv

comment:1 Changed 4 years ago by asenchi

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 4 years ago by jezdez

  • Triage Stage changed from Design decision needed to Accepted

comment:3 Changed 4 years ago by anonymous

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 4 years ago by russellm

  • Patch needs improvement set
  • Triage Stage changed from Ready for checkin to Accepted

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 4 years ago by gabrielhurley

  • Resolution set to fixed
  • Status changed from new to closed

(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 4 years ago by gabrielhurley

(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 4 years ago by adamv

  • Resolution fixed deleted
  • Status changed from closed to reopened

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 4 years ago by gabrielhurley

  • Resolution set to fixed
  • Status changed from reopened to closed

(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 4 years ago by gabrielhurley

(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