mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-14 05:37:02 +03:00
6a19ab5a4b
* use `to_represenation` in favor of `get_attribute` * fix datetime type does get converted to a string to_representation will convert the datetime field into a string representation. However the to_representation on the method field will only call its underlying method. * fix add missing import * apply black formatter * add test for serializer method field * apply black format * improve backward compatibility by using date's class contructor instead of fromisostring * apply black format * fix black format issue
17 lines
436 B
Python
17 lines
436 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()
|