[Django] #35072: Model docs Field.choices inconsistency between reference and topic guide

19 views
Skip to first unread message

Django

unread,
Dec 29, 2023, 2:20:53 PM12/29/23
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie | Owner: nobody
Beha |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 5.0
Documentation | Keywords: documentation,
Severity: Normal | model, field
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
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."

I think this inconsistency is present because support for mappings as
choices was introduced in Django 5.0, and the topic page hasn't yet been
updated to reflect that change.

--
Ticket URL: <https://code.djangoproject.com/ticket/35072>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 29, 2023, 2:22:50 PM12/29/23
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: documentation, | Triage Stage:
model, field | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Zowie Beha:

Old description:

> 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."
>
> I think this inconsistency is present because support for mappings as
> choices was introduced in Django 5.0, and the topic page hasn't yet been
> updated to reflect that change.

New description:

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."

I think this inconsistency is present because support for mappings as
choices was introduced in Django 5.0, and the topic page hasn't yet been

updated to reflect that change. It should also be mentioned that a
callable is a valid choice value.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:1>

Django

unread,
Dec 29, 2023, 2:23:53 PM12/29/23
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: documentation, | Triage Stage:
model, field | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Zowie Beha:

Old description:

> 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."
>
> I think this inconsistency is present because support for mappings as
> choices was introduced in Django 5.0, and the topic page hasn't yet been

> updated to reflect that change. It should also be mentioned that a
> callable is a valid choice value.

New description:

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."

I think this inconsistency is present because support for mappings as
choices was introduced in Django 5.0, and the topic page hasn't yet been

updated to reflect that change. It should also be mentioned in the topic
guide that a callable is a valid choice value.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:2>

Django

unread,
Dec 29, 2023, 2:24:51 PM12/29/23
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: documentation, | Triage Stage:
model, field | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Zowie Beha:

Old description:

> 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."
>
> I think this inconsistency is present because support for mappings as
> choices was introduced in Django 5.0, and the topic page hasn't yet been

> updated to reflect that change. It should also be mentioned in the topic
> guide that a callable is a valid choice value.

New description:

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."

I think this inconsistency is present because support for mappings as
choices was introduced in Django 5.0, and the topic page hasn't yet been
updated to reflect that change. It should also be mentioned in the topic

guide that a callable is a valid choices value.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:3>

Django

unread,
Dec 29, 2023, 2:25:35 PM12/29/23
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: documentation, | Triage Stage:
model, field | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Zowie Beha):

* cc: Zowie Beha (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:4>

Django

unread,
Dec 30, 2023, 3:38:07 PM12/30/23
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: Zowie
Type: | Beha
Cleanup/optimization | Status: assigned

Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: documentation, | Triage Stage:
model, field | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Zowie Beha):

* owner: nobody => Zowie Beha
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:5>

Django

unread,
Dec 30, 2023, 4:24:09 PM12/30/23
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: Zowie
Type: | Beha
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: documentation, | Triage Stage:
model, field | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Zowie Beha:

Old description:

> 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."
>
> I think this inconsistency is present because support for mappings as
> choices was introduced in Django 5.0, and the topic page hasn't yet been
> updated to reflect that change. It should also be mentioned in the topic

> guide that a callable is a valid choices value.

New description:

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).

--

--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:6>

Django

unread,
Dec 30, 2023, 5:34:04 PM12/30/23
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: Zowie
Type: | Beha
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: documentation, | Triage Stage:
model, field | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Zowie Beha):

PR: https://github.com/django/django/pull/17663

--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:7>

Django

unread,
Dec 30, 2023, 5:35:19 PM12/30/23
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: Zowie
Type: | Beha
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: documentation, | Triage Stage:
model, field | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Zowie Beha):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:8>

Django

unread,
Dec 31, 2023, 3:19:09 AM12/31/23
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: Zowie
Type: | Beha
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: documentation, | Triage Stage: Accepted
model, field |

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:9>

Django

unread,
Jan 1, 2024, 12:57:42 PM1/1/24
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: Zowie
Type: | Beha
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: documentation, | Triage Stage: Ready for
model, field | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:10>

Django

unread,
Jan 1, 2024, 11:24:23 PM1/1/24
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: Zowie
Type: | Beha
Cleanup/optimization | Status: closed
Component: Documentation | Version: 5.0
Severity: Normal | Resolution: fixed

Keywords: documentation, | Triage Stage: Ready for
model, field | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"8fcd7b01eec85a509762dd8dbb3a27b7ab521e94" 8fcd7b0]:
{{{
#!CommitTicketReference repository=""
revision="8fcd7b01eec85a509762dd8dbb3a27b7ab521e94"
Fixed #35072 -- Corrected Field.choices description in models topic.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:11>

Django

unread,
Jan 1, 2024, 11:24:44 PM1/1/24
to django-...@googlegroups.com
#35072: Model docs Field.choices inconsistency between reference and topic guide
-------------------------------------+-------------------------------------
Reporter: Zowie Beha | Owner: Zowie
Type: | Beha
Cleanup/optimization | Status: closed
Component: Documentation | Version: 5.0
Severity: Normal | Resolution: fixed
Keywords: documentation, | Triage Stage: Ready for
model, field | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"031bc4710138e36445322488a8074c1b9e835702" 031bc47]:
{{{
#!CommitTicketReference repository=""
revision="031bc4710138e36445322488a8074c1b9e835702"
[5.0.x] Fixed #35072 -- Corrected Field.choices description in models
topic.

Backport of 8fcd7b01eec85a509762dd8dbb3a27b7ab521e94 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:12>

Reply all
Reply to author
Forward
0 new messages