#32706: Ambiguity around field choices in the Model Field section
------------------------------------------------+------------------------
Reporter: logankilpatrick | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
I am reading here:
https://docs.djangoproject.com/en/3.2/ref/models/fields/#django.db.models.Field.choices
about field choices. The docs remark that:
> "Generally, it’s best to define choices inside a model class, and to
define a suitably-named constant for each value:"
Why is this? Looking at the code, it is not abundantly clear to me as a
developer why this is the case. I think folks would benefit from a
sentence or two of commentary as to why this approach is generally better.
--
Ticket URL: <https://code.djangoproject.com/ticket/32706>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/058.7aca537ff21a3b9c1c978e38a188b706%40djangoproject.com.