Very similar logic exists in filer.utils.generat_filename._construct_logical_folder_path and filertags.signals._construct_logical_folder_path

I think it would be best to add this logic as methods in File and Folder and remove all the above duplication.
After all, it's a File and Folder's responsibility to know how to build it's logical_path