graphql-python / graphql-python/graphene-sqlalchemy

Enum ChoiceType column results in error

Aperta
#196 6 commenti 1 reazione 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
985
Fork
223
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.