graphene-django/graphene_django/rest_framework/models.py

28 lines
665 B
Python
Raw Normal View History

2017-11-13 23:35:00 +03:00
from django.db import models
class MyFakeModel(models.Model):
cool_name = models.CharField(max_length=50)
2017-11-15 01:10:26 +03:00
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,
)