Updated document indexing app modules for the new
filename and extension merged field
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
import os
|
||||
|
||||
from document_indexing.conf.settings import SUFFIX_SEPARATOR
|
||||
|
||||
|
||||
def assemble_document_filename(document, suffix=0):
|
||||
def assemble_document_filename(filename, suffix=0):
|
||||
'''
|
||||
Split document filename, to attach suffix to the name part then
|
||||
re attacht the extension
|
||||
'''
|
||||
|
||||
if suffix:
|
||||
return SUFFIX_SEPARATOR.join([document.file_filename, unicode(suffix)])
|
||||
name, extension = filename.split(os.split(os.extsep))
|
||||
return SUFFIX_SEPARATOR.join([name, unicode(suffix), os.extsep, extension])
|
||||
else:
|
||||
return document.file_filename
|
||||
return file_filename
|
||||
|
||||
Reference in New Issue
Block a user