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.
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>
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>
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>
* cc: Zowie Beha (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:4>
* owner: nobody => Zowie Beha
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:5>
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>
Comment (by Zowie Beha):
PR: https://github.com/django/django/pull/17663
--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:7>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:8>
* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:9>
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/35072#comment:10>
* 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>
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>