def import_field(field_classpath):
    """
    Imports a field by its dotted class path, prepending "django.db.models"
    to raw class names and raising an exception if the import fails.
    """
    if '.' in field_classpath:
        fully_qualified = field_classpath
    else:
        fully_qualified = "django.db.models.%s" % field_classpath
    try:
        return import_dotted_path(fully_qualified)
    except ImportError:
        raise ImproperlyConfigured("The EXTRA_MODEL_FIELDS setting contains "
                                   "the field '%s' which could not be "
                                   "imported." % field_classpath)
dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/boot/__init__.py/import_field/original