def _lookup_identifier_method():
 if (not hasattr(settings, u'HAYSTACK_IDENTIFIER_METHOD')):
  return default_get_identifier
 (module_path, method_name) = settings.HAYSTACK_IDENTIFIER_METHOD.rsplit(u'.', 1)
 try:
  module = importlib.import_module(module_path)
 except ImportError:
  raise ImportError((u"Unable to import module '%s' provided for HAYSTACK_IDENTIFIER_METHOD." % module_path))
 identifier_method = getattr(module, method_name, None)
 if (not identifier_method):
  raise AttributeError((u"Provided method '%s' for HAYSTACK_IDENTIFIER_METHOD does not exist in '%s'." % (method_name, module_path)))
 return identifier_method

def _lookup_identifier_method ( ) : if ( not hasattr ( settings , u'HAYSTACK_IDENTIFIER_METHOD' ) ) : return default_get_identifier ( module_path , method_name ) = settings . HAYSTACK_IDENTIFIER_METHOD . rsplit ( u'.' , 1 ) try : module = importlib . import_module ( module_path ) except ImportError : raise ImportError ( ( u"Unable to import module '%s' provided for HAYSTACK_IDENTIFIER_METHOD." % module_path ) ) identifier_method = getattr ( module , method_name , None ) if ( not identifier_method ) : raise AttributeError ( ( u"Provided method '%s' for HAYSTACK_IDENTIFIER_METHOD does not exist in '%s'." % ( method_name , module_path ) ) ) return identifier_method
if the user has set haystack_identifier_method .