#NEWLINE# def delete( self , instance , session ) : #NEWLINE# #INDENT# 'delete an *instance*' #NEWLINE# if ( inst . _meta . type == 'structure' ) : #NEWLINE# #INDENT# return self . _delete_structure ( instance ) #NEWLINE# #UNINDENT# inst = self . pop ( instance ) #NEWLINE# instance = ( inst if ( inst is not None ) else instance ) #NEWLINE# if ( instance is not None ) : #NEWLINE# #INDENT# state = instance . get_state ( ) #NEWLINE# if state . persistent : #NEWLINE# #INDENT# state . deleted = True #NEWLINE# self . _deleted [ state . iid ] = instance #NEWLINE# instance . session = session #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# instance . session = None #NEWLINE# #UNINDENT# return instance