Added support for FilePathField

This commit is contained in:
Syrus Akbary 2018-06-05 14:39:51 -07:00
parent 4e7b269b76
commit 27a7c0e299
2 changed files with 5 additions and 0 deletions

View File

@ -80,6 +80,7 @@ def convert_django_field(field, registry=None):
@convert_django_field.register(models.URLField)
@convert_django_field.register(models.GenericIPAddressField)
@convert_django_field.register(models.FileField)
@convert_django_field.register(models.FilePathField)
def convert_field_to_string(field, registry=None):
return String(description=field.help_text, required=not field.null)

View File

@ -82,6 +82,10 @@ def test_should_image_convert_string():
assert_conversion(models.ImageField, graphene.String)
def test_should_url_convert_string():
assert_conversion(models.FilePathField, graphene.String)
def test_should_auto_convert_id():
assert_conversion(models.AutoField, graphene.ID, primary_key=True)