#NEWLINE# def create( self , document_id ) : #NEWLINE# #INDENT# document = self . _get_document ( document_id ) #NEWLINE# self . validator . parse_post ( [ ] , [ ] ) #NEWLINE# if len ( request . files ) : #NEWLINE# #INDENT# attachments = self . attach_files ( document ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# error ( 'No file attachments found.' ) #NEWLINE# #UNINDENT# return jsonify ( { #NEWLINE# #INDENT# 'attachments' : [ attachment . serialize ( ) for attachment in attachments ] , #NEWLINE# #UNINDENT# } )