def get_identifier_method(key):
 if hasattr(key, u'get_custom_haystack_id'):
  return key.get_custom_haystack_id()
 else:
  key_bytes = key.encode(u'utf-8')
  return hashlib.md5(key_bytes).hexdigest()

def get_identifier_method ( key ) : if hasattr ( key , u'get_custom_haystack_id' ) : return key . get_custom_haystack_id ( ) else : key_bytes = key . encode ( u'utf-8' ) return hashlib . md5 ( key_bytes ) . hexdigest ( )
custom get_identifier method used for testing the setting haystack_identifier_module .