#34388: Added support for direct usage of Choices classes on model fields
-------------------------------------+-------------------------------------
Reporter: T. Franzel | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Adam Johnson):
There is though a constant stream of complaints that run from “Django’s
loose APIs mean it can’t be typed” to (even) “Django is holding back
typing in Python” because of this. Generally adding a Union to a type
isn’t going to please folks concerned about this. However maybe that’s
Python typing’s problem and not ours 🤔 I’ll cc Adam and let him decide.
I think django-stubs would be fine adding Choices to the union.
If we do this, we should only allow Choices subclasses, not generic
enums.
+1
Also, given it wouldn't be used internally, we'd need to comment in the
code carefully to prevent regression and it'd be semi-public API, but
undocumented.
Why would this be an undocumented API?
--
Ticket URL: <https://code.djangoproject.com/ticket/34388#comment:8>
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/01070186cc7c1d26-eb3cd3b7-7b59-4ba2-b244-d8466f03fa20-000000%40eu-central-1.amazonses.com.