#NEWLINE# def _save_doc_to_db( self , docname , doc_class ) : #NEWLINE# #INDENT# doc_dict = _get_doc_data ( docname ) #NEWLINE# try : #NEWLINE# #INDENT# doc_instance = doc_class . wrap ( doc_dict ) #NEWLINE# doc_instance . save ( ) #NEWLINE# #UNINDENT# except ResourceConflict : #NEWLINE# #INDENT# doc_instance = doc_class . get ( doc_dict [ '_id' ] ) #NEWLINE# doc_instance . _doc . update ( doc_dict ) #NEWLINE# #UNINDENT# return doc_dict [ '_id' ]