Convert the 'document_save_to_temp_dir' utility function into a method of the Document model

This commit is contained in:
Roberto Rosario
2014-10-13 17:51:28 -04:00
parent f3de7f84f2
commit 8200204ddc
3 changed files with 8 additions and 13 deletions

View File

@@ -1,8 +0,0 @@
import os
from common.settings import TEMPORARY_DIRECTORY
def document_save_to_temp_dir(document, filename, buffer_size=1024 * 1024):
temporary_path = os.path.join(TEMPORARY_DIRECTORY, filename)
return document.save_to_file(temporary_path, buffer_size)