#34388: Added support for direct usage of Choices classes on model fields
-------------------------------------+-------------------------------------
Reporter: T. Franzel | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
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 Carlton Gibson):
> …someone else will be needed to approve this feature :)
That's not true David. You're more than welcome to accept tickets. (The
requirement being,
[https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
tickets/#unreviewed do you feel qualified?] — I'm sure you are :)
From the PR:
> The argument now supports both explicit and implicit usage.
I have two small worries:
> Explicit is better than implicit.
> ...
> There should be one-- and preferably only one --obvious way to do it.
Seems like we're violating both of those. 🤔
Maybe it's worth it but — and I realise I'm always saying this to you Tim
😬 — the reference to the Choices class is unused in Django, and I worry
about adding API for external packages, when it would be much better (for
all involved) for them to keep control of it themselves.
Essentially you want the field to maintain a reference to the Choices
class, so you can inspect it later, but in this case I'd think a decorator
in drf-spectacular adding the necessary annotation would be much more
coherent, than having Django maintain the (from it's POV) other idle
reference.
Also from the PR:
> Is it the "so far away" 5.0 then?
Yes. So the other point about keeping your API in your package is that
you're not tied to Django's (super long) release cycle.
--
Ticket URL: <https://code.djangoproject.com/ticket/34388#comment:2>
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/01070186bb087a22-c39db5f9-ec94-47ea-8ce7-e34db06842f9-000000%40eu-central-1.amazonses.com.