Closed
Description
It would be awesome to see something like this:
class Foo(models.Model):
TWITTER = 'twitter'
WEBSITE = 'website'
FULL_NAME = 'full_name'
IDENTITY_CHOICES = (
(TWITTER, 'Twitter'),
(WEBSITE, 'Website'),
(FULL_NAME, 'Full Name'),
)
main_identity = models.CharField(max_length=10, choices=IDENTITY_CHOICES, default=FULL_NAME)
turned into something like this:
class Identity(graphene.Enum):
TWITTER = Foo.TWITTER
WEBSITE = Foo.WEBSITE
FULL_NAME = Foo.FULL_NAME
class FooType(DjangoObjectType):
main_identity = graphene.NonNull(Identity)
class Meta:
model = Foo
automatically. I will work on this if I have time to implement it.
Metadata
Metadata
Assignees
Labels
No labels