[Answer]-Get_internal_error() returns CharField instead of EmailField & URLField

1👍

✅

If you need to special-case these types, use the name of the class instead:

type(field).__name__  # get name of the field class, instead of field.get_internal_type()

Both EmailField and URLField are Charfield subclasses, just with a maximum length pre-set and a dedicated validator.

Leave a comment