#NEWLINE# def presort_deletes( self , uowcommit , states ) : #NEWLINE# #INDENT# should_null_fks = ( ( not self . cascade . delete ) and ( not ( self . passive_deletes == 'all' ) ) ) #NEWLINE# for state in states : #NEWLINE# #INDENT# history = uowcommit . get_attribute_history ( state , self . key , self . _passive_delete_flag ) #NEWLINE# if history : #NEWLINE# #INDENT# for child in history . deleted : #NEWLINE# #INDENT# if ( ( child is not None ) and ( self . hasparent ( child ) is False ) ) : #NEWLINE# #INDENT# if self . cascade . delete_orphan : #NEWLINE# #INDENT# uowcommit . register_object ( child , isdelete = True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# uowcommit . register_object ( child ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if should_null_fks : #NEWLINE# #INDENT# for child in history . unchanged : #NEWLINE# #INDENT# if ( child is not None ) : #NEWLINE# #INDENT# uowcommit . register_object ( child , operation = 'delete' , prop = self . prop )