#NEWLINE# def stash( self , storage , url ) : #NEWLINE# #INDENT# 'Stores the uploaded file in a temporary storage location.' #NEWLINE# result = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if self . is_valid ( ) : #NEWLINE# #INDENT# upload = self . cleaned_data [ 'upload' ] #NEWLINE# name = storage . save ( upload . name , upload ) #NEWLINE# result [ 'filename' ] = os . path . basename ( name ) #NEWLINE# try : #NEWLINE# #INDENT# result [ 'url' ] = storage . url ( upload ) #NEWLINE# #UNINDENT# except NotImplementedError : #NEWLINE# #INDENT# result [ 'url' ] = None #NEWLINE# #UNINDENT# result [ 'stored' ] = serialize_upload ( name , storage , url ) #NEWLINE# #UNINDENT# return result