#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 <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/0107018cb7076bc9-84b5d9fc-08d4-46f3-b971-2cd153c654ba-000000%40eu-central-1.amazonses.com.