Skip to content

Commit

Permalink
Added FileField and ImageField conversion. Fixed #137
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Apr 2, 2016
1 parent 1f548f1 commit a1dd2b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions graphene/contrib/django/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def convert_django_field(field):
@convert_django_field.register(models.SlugField)
@convert_django_field.register(models.URLField)
@convert_django_field.register(models.GenericIPAddressField)
@convert_django_field.register(models.FileField)
@convert_django_field.register(UUIDField)
def convert_field_to_string(field):
return String(description=field.help_text)
Expand Down
8 changes: 8 additions & 0 deletions graphene/contrib/django/tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ def test_should_ipaddress_convert_string():
assert_conversion(models.GenericIPAddressField, graphene.String)


def test_should_file_convert_string():
assert_conversion(models.FileField, graphene.String)


def test_should_image_convert_string():
assert_conversion(models.ImageField, graphene.String)


def test_should_auto_convert_id():
assert_conversion(models.AutoField, graphene.ID, primary_key=True)

Expand Down

0 comments on commit a1dd2b6

Please sign in to comment.