Format code

This commit is contained in:
Jonathan Kim 2019-07-09 13:32:04 +01:00
parent aa04fd7f8f
commit 730e17f23c
2 changed files with 9 additions and 3 deletions

View File

@ -57,7 +57,9 @@ def convert_serializer_field(field, is_input=True):
def convert_serializer_to_input_type(serializer_class):
cached_type = convert_serializer_to_input_type.cache.get(serializer_class.__name__, None)
cached_type = convert_serializer_to_input_type.cache.get(
serializer_class.__name__, None
)
if cached_type:
return cached_type
serializer = serializer_class()

View File

@ -18,8 +18,12 @@ class MyFakeChildModel(models.Model):
class MyFakeParentModel(models.Model):
name = models.CharField(max_length=50)
created = models.DateTimeField(auto_now_add=True)
child1 = models.OneToOneField(MyFakeChildModel, related_name='parent1', on_delete=models.CASCADE)
child2 = models.OneToOneField(MyFakeChildModel, related_name='parent2', on_delete=models.CASCADE)
child1 = models.OneToOneField(
MyFakeChildModel, related_name="parent1", on_delete=models.CASCADE
)
child2 = models.OneToOneField(
MyFakeChildModel, related_name="parent2", on_delete=models.CASCADE
)
class ParentType(DjangoObjectType):