def filer_folder_from_path(path):
 if (path is None):
  return None
 folder = None
 for component in six.text_type(path).split('/'):
  if component:
   folder = Folder.objects.get_or_create(name=component, parent=folder)[0]
 return folder

def filer_folder_from_path ( path ) : if ( path is None ) : return None folder = None for component in six . text_type ( path ) . split ( '/' ) : if component : folder = Folder . objects . get_or_create ( name = component , parent = folder ) [ 0 ] return folder
split path by slashes and create a hierarchy of filer folder objects accordingly .