Skip to content

A Slightly smarter enum conversion #654

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

Closed

Conversation

zbyte64
Copy link
Collaborator

@zbyte64 zbyte64 commented May 30, 2019

Tweaks the enum generator for the django model field converter. When generating an enum name, if the choice value is not a string then use the choice label instead. The result is smarter enum labels for integer fields. Check out the changes in unit testing as an example of better usage.

Not backwards compatible.

Partially addresses #649

@coveralls
Copy link

coveralls commented May 30, 2019

Coverage Status

Coverage increased (+0.03%) to 92.749% when pulling 32d2808 on zbyte64:smarter_enum_conversion into b0cba39 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 92.561% when pulling dc5799e on zbyte64:smarter_enum_conversion into b0cba39 on graphql-python:master.

5 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 92.561% when pulling dc5799e on zbyte64:smarter_enum_conversion into b0cba39 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 92.561% when pulling dc5799e on zbyte64:smarter_enum_conversion into b0cba39 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 92.561% when pulling dc5799e on zbyte64:smarter_enum_conversion into b0cba39 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 92.561% when pulling dc5799e on zbyte64:smarter_enum_conversion into b0cba39 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 92.561% when pulling dc5799e on zbyte64:smarter_enum_conversion into b0cba39 on graphql-python:master.

@zbyte64
Copy link
Collaborator Author

zbyte64 commented May 31, 2019

The enum converter now strips non-ascii characters as the graphene does not support non-ascii enum names.

@zbyte64
Copy link
Collaborator Author

zbyte64 commented Jun 5, 2019

Will now prefix choices with "A" if it starts with an underscore. That is to fix #141

@zbyte64
Copy link
Collaborator Author

zbyte64 commented Jun 7, 2019

Realized that #23 specifically opted to use values for enum generation as they are less likely to change.

@zbyte64 zbyte64 mentioned this pull request Jun 10, 2019
@stale
Copy link

stale bot commented Aug 7, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 7, 2019
@stale stale bot closed this Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants