#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 David Wobrock):
Replying to [comment:2 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 :)
Hihi, thank you 🤗
>
> 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. 🤔
Passing a `Choices` class makes sense, instead of doing the strange
`choices=MyChoices.choices` manipulation. As it feels more like the
''expected'' way of using this parameter.
However, I strongly agree that it would be preferred to have only one way
of doing things.
If we were to engage in a transition to deprecate passing an iterable of
two items, and solely accept `Choices` classes, that would be n annoying
breaking change for many projects, with no good reason/added value 😕
From this point of view, I'm rather in favor of considering this as
Won't-Do.
--
Ticket URL: <https://code.djangoproject.com/ticket/34388#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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070186bc4ca21b-9d823690-782c-4654-91fa-1ff691df8578-000000%40eu-central-1.amazonses.com.