On Sat, 13 Apr 2019 08:22:11 -0400
"Markus Holtermann" <[email protected]> wrote:
>
> 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()`)
>
Yes, that's an improvement.
> Further, we could also simplify the Fields API more and do this:
>
> class Card(models.Model):
> suit = models.IntegerField(choices=Suit)
>
I have doubts about this, because enum classes are iterable -- so at
first look, it might not be totally obvious of
suit = models.IntegerField(choices=Suit)
actually means
suit = models.IntegerField(choices=list(Suit))
or
suit = models.IntegerField(choices=Suit.choices())
although the repetition of the word "choices" in the last version is a
bit jarring. I could be convinced to change my mind.
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 [email protected].
To post to this group, send email to [email protected].
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/20190413171918.60c5fc66.shai%40platonix.com.
For more options, visit https://groups.google.com/d/optout.