#24342: Add an EnumField as standard
-------------------------------------+-------------------------------------
Reporter: ovangle | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.7
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by ovangle):
For us, it has replaced the use of choices everywhere, although we don't
use django forms (django only powers our REST API). The enum names are
stored in the database column and the implementation is agnostic to the
enum values. Our implementation is currently postgres specific, but should
be relatively easily to make generic.
But there are (dubious) use cases supported by choices that can't be
easily filled by enums (such as defining named groups of values in a
`<select>` form element), so I don't think choices can be deprecated
entirely. Perhaps an optional `form_groups` argument to `EnumField` would
satisfy this use case if a decision to deprecate choices were made in
response to this.
--
Ticket URL: <https://code.djangoproject.com/ticket/24342#comment:3>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.198e834afd8bbe337335d666220d9cbb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.