-
Notifications
You must be signed in to change notification settings - Fork 227
add support for enums in sqlalchemy ChoiceType #240
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
Conversation
Thanks for sending a PR. Would you mind updating the tests in You can see how to run the tests locally here: https://github.com/graphql-python/graphene-sqlalchemy/blob/master/CONTRIBUTING.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops - I didn't see your update until now. Thanks for adding the tests. I have one minor comment about a deleted TODO but I'm fine punting on it if you don't have time to put it back.
Since it seems you are using ChoiceType, you may be interested in addressing the TODO in a later PR. It should make it a lot easier to deal with auto-generated Enums (see my comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops - completely fell off my radar. Sorry for the delay.
@metheoryt Btw in case you're interested, here is more context on the TODO. The enums auto-generated by ChoiceLabel are not as clean and robust as other enum columns:
This PR added proper support for enums but did not include ChoiceType. I think it would be quite straightforward to have ChoiceType leverage the same infrastructure. Cheers |
Hi! I've found that I cannot use python enums with sqlalchemy_utils's ChoiceType, so here's my solution for it