#NEWLINE# @ require_context #NEWLINE# def restore_item( context , kind , data ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# item_ref = models . Item ( ) #NEWLINE# item_ref . update ( { #NEWLINE# #INDENT# 'project_id' : context . project_id , #NEWLINE# #UNINDENT# } ) #NEWLINE# item_ref . id = data [ 'id' ] #NEWLINE# item_ref . update ( _pack_item_data ( data ) ) #NEWLINE# item_ref . save ( ) #NEWLINE# return _unpack_item_data ( item_ref ) #NEWLINE# #UNINDENT# except db_exception . DBDuplicateEntry : #NEWLINE# #INDENT# raise exception . EC2DBDuplicateEntry ( id = data [ 'id' ] )