Update converter.py

This commit is contained in:
Momotv45 2016-10-07 17:21:15 +01:00 committed by GitHub
parent 6b75358008
commit ab5e118975

View File

@ -57,6 +57,7 @@ def convert_django_field(field, registry=None):
"Don't know how to convert the Django field %s (%s)" %
(field, field.__class__))
def get_phone_number_field():
try:
from phonenumber_field.formfields import PhoneNumberField
@ -68,12 +69,14 @@ def get_phone_number_field():
pass
return models.CharField
def get_duration_field():
try:
return models.DurationField
except:
return models.CharField
@convert_django_field.register(get_phone_number_field())
@convert_django_field.register(get_duration_field())
@convert_django_field.register(models.CharField)