Skip to content

MySQL Enum conversion issue #147

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
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion graphene_sqlalchemy/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ def convert_enum_to_enum(type, column, registry=None):
items = type.enum_class.__members__.items()
except AttributeError:
items = zip(type.enums, type.enums)

enum_name = type.name or "{}_{}".format(column.table, column.name)

return Field(
Enum(type.name, items),
Enum(enum_name, items),
description=get_column_doc(column),
required=not (is_column_nullable(column)),
)
Expand Down