graphql-python / graphql-python/graphene-sqlalchemy

Enum ChoiceType column results in error

未关闭
#196 6 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Python
星标
985
派生
223
PR 合并指标
30 天内没有已合并 PR

描述

Howdy folks!

The following code produces `TypeError: 'MyEnum' object is not iterable`, but should work. Note that this is also involves package `sqlalchemy_utils`

```py
from enum import Enum

class MyEnum(Enum):
foo = 1
bar = 2

class MyModel(Base):
id = Column(sa.Integer, primary_key=True)
name = Column(sa.Unicode(255))
type = Column(ChoiceType(MyEnum, impl=Integer()))

class MyObject(SQLAlchemyObjectType):
class Meta:
model = MyModel
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。