def upload_to(field_path, default):
 from mezzanine.conf import settings
 for (k, v) in settings.UPLOAD_TO_HANDLERS.items():
  if (k.lower() == field_path.lower()):
   return import_dotted_path(v)
 return default

def upload_to ( field_path , default ) : from mezzanine . conf import settings for ( k , v ) in settings . UPLOAD_TO_HANDLERS . items ( ) : if ( k . lower ( ) == field_path . lower ( ) ) : return import_dotted_path ( v ) return default
used as the upload_to arg for file fields - allows for custom handlers to be implemented on a per field basis defined by the upload_to_handlers setting .