Merge pull request #71 from lightning18/ip-address-field

Add support for GenericIPAddressField
This commit is contained in:
Syrus Akbary 2015-12-12 10:58:57 -08:00
commit 9b8c75be9a
2 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,7 @@ def convert_django_field(field):
@convert_django_field.register(models.EmailField) @convert_django_field.register(models.EmailField)
@convert_django_field.register(models.SlugField) @convert_django_field.register(models.SlugField)
@convert_django_field.register(models.URLField) @convert_django_field.register(models.URLField)
@convert_django_field.register(models.GenericIPAddressField)
@convert_django_field.register(UUIDField) @convert_django_field.register(UUIDField)
def convert_field_to_string(field): def convert_field_to_string(field):
return String(description=field.help_text) return String(description=field.help_text)

View File

@ -48,6 +48,10 @@ def test_should_url_convert_string():
assert_conversion(models.URLField, graphene.String) assert_conversion(models.URLField, graphene.String)
def test_should_ipaddress_convert_string():
assert_conversion(models.GenericIPAddressField, graphene.String)
def test_should_auto_convert_id(): def test_should_auto_convert_id():
assert_conversion(models.AutoField, graphene.ID) assert_conversion(models.AutoField, graphene.ID)