Hi Fernando,

On Mon, 16 Sep 2019 08:59:17 -0700 (PDT)
Fernando Macedo <[email protected]> wrote:

> Hi everyone, I come late to the party and only noticed that Django
> now has support for enums on the 3.0 release notes. As I'm not a core
> developer I never imagined this.

Late is better than never... I should point out that contribution to
the project is open -- neither I, who initiated this work, nor Nick,
who pulled most of the rest of the way, are currently members of the
project's Technical Team ("core developers").

This, of course, is not intended as an admonition, but rather as an
invitation. Come join us, one and all!

> 
> I've wrote a lib that does something similar in mid-2018: 
> https://github.com/loggi/python-choicesenum
> 
> There's one main diff from the Python default behaviour: The default
> enum requires that you compare the enum against their value,
> something like `assert EnumClass.EnumItem.value == 3`, my custom
> implementation allow usage with `assert EnumClass.EnumItem == 3`, the
> expected behaviour IMHO.
> 

I believe Django's enum classes also have this property. I took a short
glance at your implementation, and I believe Django's has most of its
features; you're welcome to take a look at ours[1] and note if we
missed anything important. If we did, perhaps there's still time to fix
it before the Beta.

[1] https://github.com/django/django/blob/stable/3.0.x/django/db/models/enums.py

Thanks for coming forward with this,

        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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/20190918104033.2618863b.shai%40platonix.com.

Reply via email to