def generate_filename(instance, old_filename):
 extension = os.path.splitext(old_filename)[1]
 filename = (str(time.time()) + extension)
 return ('documents/files/' + filename)

def generate_filename ( instance , old_filename ) : extension = os . path . splitext ( old_filename ) [ 1 ] filename = ( str ( time . time ( ) ) + extension ) return ( 'documents/files/' + filename )
generate filename .