Thanks for the proposal, Shai. I quite like it. As discussed at the DCEU sprints I think I'd like to be able to omit the display form of an item and have it auto generated from an item's name, i.e. turning "FOO_BAR" into "Foo Bar" (`key.replace("_", " ").title()`)
Further, we could also simplify the Fields API more and do this: class Card(models.Model): suit = models.IntegerField(choices=Suit) Cheers, /Markus On Sat, Apr 13, 2019, at 11:33 AM, Shai Berger wrote: > Back to this issue for the DjangoCon EU sprints... > > James' objection about the inclusion testing needed for validation > seems moot, because validation can be done by conversion to the enum > type (as noted by Tom). > > Raphael's warning about the woes of translation are already handled by > the suggested implementation -- because it isn't the enum value that > we make translatable, but rather an attribute on it. > > I should point that the suggested implementation uses IntEnum and > StrEnum. The Python documentation recommends against using these, > except in the case that one needs to account for compatibility with an > existing protocol -- which, I submit to you, is exactly our case (the > "protocol" being the types available for database fields). > > As a reminder, the relevant links are: > > https://code.djangoproject.com/ticket/27910 > https://github.com/django/django/compare/master...shaib:ticket_27910?expand=1 > > Thanks, > Shai. > > -- > You received this message because you are subscribed to the Google > Groups "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to django-developers+unsubscr...@googlegroups.com. > To post to this group, send email to django-developers@googlegroups.com. > Visit this group at https://groups.google.com/group/django-developers. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/20190413113323.1342ed7d.shai%40platonix.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/e86e12b7-2ee0-4585-ad69-4e22613f0128%40www.fastmail.com. For more options, visit https://groups.google.com/d/optout.