mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-24 18:44:08 +03:00
5d7a04fce9
* Fix for issue #1385: Update mutation.py to serialize Enum objects into input values for ChoiceFields * Update graphene_django/rest_framework/mutation.py Co-authored-by: Steven DeMartini <1647130+sjdemartini@users.noreply.github.com> --------- Co-authored-by: Steven DeMartini <1647130+sjdemartini@users.noreply.github.com>
28 lines
665 B
Python
28 lines
665 B
Python
from django.db import models
|
|
|
|
|
|
class MyFakeModel(models.Model):
|
|
cool_name = models.CharField(max_length=50)
|
|
created = models.DateTimeField(auto_now_add=True)
|
|
|
|
|
|
class MyFakeModelWithPassword(models.Model):
|
|
cool_name = models.CharField(max_length=50)
|
|
password = models.CharField(max_length=50)
|
|
|
|
|
|
class MyFakeModelWithDate(models.Model):
|
|
cool_name = models.CharField(max_length=50)
|
|
last_edited = models.DateField()
|
|
|
|
|
|
class MyFakeModelWithChoiceField(models.Model):
|
|
class ChoiceType(models.Choices):
|
|
ASDF = "asdf"
|
|
HI = "hi"
|
|
|
|
choice_type = models.CharField(
|
|
max_length=4,
|
|
default=ChoiceType.HI.name,
|
|
)
|