Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#35072 closed Cleanup/optimization (fixed)

Model docs Field.choices inconsistency between reference and topic guide

Reported by: Zowie Beha Owned by: Zowie Beha
Component: Documentation Version: 5.0
Severity: Normal Keywords: documentation, model, field
Cc: Zowie Beha Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Zowie Beha)

https://docs.djangoproject.com/en/5.0/ref/models/fields/#django.db.models.Field.choices

On this reference page, Field.choices is described as:
"A mapping or iterable in the format described below to use as choices for this field."

https://docs.djangoproject.com/en/5.0/topics/db/models/#field-options

Here on the topic guide however, the description is:
"A sequence of 2-tuples to use as choices for this field."

A mapping is used as an example in the topic guide, however it might be better to mention explicitly/upfront all valid choices values (such as callables for example).

Change History (12)

comment:1 by Zowie Beha, 5 months ago

Description: modified (diff)

comment:2 by Zowie Beha, 5 months ago

Description: modified (diff)

comment:3 by Zowie Beha, 5 months ago

Description: modified (diff)

comment:4 by Zowie Beha, 5 months ago

Cc: Zowie Beha added

comment:5 by Zowie Beha, 5 months ago

Owner: changed from nobody to Zowie Beha
Status: newassigned

comment:6 by Zowie Beha, 5 months ago

Description: modified (diff)

comment:8 by Zowie Beha, 5 months ago

Has patch: set

comment:9 by Mariusz Felisiak, 5 months ago

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:10 by Mariusz Felisiak, 5 months ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:11 by Mariusz Felisiak <felisiak.mariusz@…>, 5 months ago

Resolution: fixed
Status: assignedclosed

In 8fcd7b0:

Fixed #35072 -- Corrected Field.choices description in models topic.

comment:12 by Mariusz Felisiak <felisiak.mariusz@…>, 5 months ago

In 031bc47:

[5.0.x] Fixed #35072 -- Corrected Field.choices description in models topic.

Backport of 8fcd7b01eec85a509762dd8dbb3a27b7ab521e94 from main

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