#NEWLINE# def process_saves( self , uowcommit , states ) : #NEWLINE# #INDENT# secondary_delete = [ ] #NEWLINE# secondary_insert = [ ] #NEWLINE# secondary_update = [ ] #NEWLINE# processed = self . _get_reversed_processed_set ( uowcommit ) #NEWLINE# tmp = set ( ) #NEWLINE# for state in states : #NEWLINE# #INDENT# need_cascade_pks = ( ( not self . passive_updates ) and self . _pks_changed ( uowcommit , state ) ) #NEWLINE# if need_cascade_pks : #NEWLINE# #INDENT# passive = attributes . PASSIVE_OFF #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# passive = attributes . PASSIVE_NO_INITIALIZE #NEWLINE# #UNINDENT# history = uowcommit . get_attribute_history ( state , self . key , passive ) #NEWLINE# if history : #NEWLINE# #INDENT# for child in history . added : #NEWLINE# #INDENT# if ( ( processed is not None ) and ( ( state , child ) in processed ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# associationrow = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( not self . _synchronize ( state , child , associationrow , False , uowcommit , 'add' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# secondary_insert . append ( associationrow ) #NEWLINE# #UNINDENT# for child in history . deleted : #NEWLINE# #INDENT# if ( ( processed is not None ) and ( ( state , child ) in processed ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# associationrow = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( not self . _synchronize ( state , child , associationrow , False , uowcommit , 'delete' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# secondary_delete . append ( associationrow ) #NEWLINE# #UNINDENT# tmp . update ( ( ( c , state ) for c in ( history . added + history . deleted ) ) ) #NEWLINE# if need_cascade_pks : #NEWLINE# #INDENT# for child in history . unchanged : #NEWLINE# #INDENT# associationrow = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# sync . update ( state , self . parent , associationrow , 'old_' , self . prop . synchronize_pairs ) #NEWLINE# sync . update ( child , self . mapper , associationrow , 'old_' , self . prop . secondary_synchronize_pairs ) #NEWLINE# secondary_update . append ( associationrow ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if ( processed is not None ) : #NEWLINE# #INDENT# processed . update ( child ) #NEWLINE# #UNINDENT# self . _run_crud ( uowcommit , secondary_insert , secondary_update , secondary_delete )