mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-29 13:03:44 +03:00
Update converter.py
This commit is contained in:
parent
6b75358008
commit
ab5e118975
|
@ -57,6 +57,7 @@ def convert_django_field(field, registry=None):
|
||||||
"Don't know how to convert the Django field %s (%s)" %
|
"Don't know how to convert the Django field %s (%s)" %
|
||||||
(field, field.__class__))
|
(field, field.__class__))
|
||||||
|
|
||||||
|
|
||||||
def get_phone_number_field():
|
def get_phone_number_field():
|
||||||
try:
|
try:
|
||||||
from phonenumber_field.formfields import PhoneNumberField
|
from phonenumber_field.formfields import PhoneNumberField
|
||||||
|
@ -68,12 +69,14 @@ def get_phone_number_field():
|
||||||
pass
|
pass
|
||||||
return models.CharField
|
return models.CharField
|
||||||
|
|
||||||
|
|
||||||
def get_duration_field():
|
def get_duration_field():
|
||||||
try:
|
try:
|
||||||
return models.DurationField
|
return models.DurationField
|
||||||
except:
|
except:
|
||||||
return models.CharField
|
return models.CharField
|
||||||
|
|
||||||
|
|
||||||
@convert_django_field.register(get_phone_number_field())
|
@convert_django_field.register(get_phone_number_field())
|
||||||
@convert_django_field.register(get_duration_field())
|
@convert_django_field.register(get_duration_field())
|
||||||
@convert_django_field.register(models.CharField)
|
@convert_django_field.register(models.CharField)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user