graphql-python / graphql-python/graphene-sqlalchemy
Enum ChoiceType column results in error
Đang mở
bug
- Ngôn ngữ chính
- Python
- Star
- 985
- Fork
- 223
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
```
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.