#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 <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018cbc9cd9f1-d35456ba-b7f7-4a3c-a1af-07ff43392afa-000000%40eu-central-1.amazonses.com.

Reply via email to