Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dataclass enums. #58

Open
bckohan opened this issue Jan 20, 2024 · 2 comments
Open

Support dataclass enums. #58

bckohan opened this issue Jan 20, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@bckohan
Copy link
Owner

bckohan commented Jan 20, 2024

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.

@bckohan bckohan added the enhancement New feature or request label Jan 20, 2024
@bckohan bckohan added this to the Version 2.0 milestone Jan 20, 2024
@bckohan bckohan self-assigned this Jan 20, 2024
@bckohan
Copy link
Owner Author

bckohan commented Sep 9, 2024

This might be OBE by #19

@bckohan bckohan removed this from the Version 2.0 milestone Sep 9, 2024
@bckohan
Copy link
Owner Author

bckohan commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant