-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
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.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
bckohan commentedon Sep 9, 2024
This might be OBE by #19
bckohan commentedon Sep 10, 2024
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.