Open bckohan opened 8 months ago
This might be OBE by #19
I explored this in this branch https://github.com/bckohan/django-enum/tree/dataclasses
Its more involved than I hoped. Certainly not impossible, but I put pause on it because #19 might satisfy this for the general case on every RDBMS but sqlite which does not yet support enumeration column types.
https://docs.python.org/3/howto/enum.html#enum-dataclass-support
enum properties is still a better way to do this - but not being part of stdlib more folks will use dataclass enumerations so django-enum should support it.
This will require adding another kwarg to the EnumField constructor that allows developers to specify the 'value' field on the dataclass.