#NEWLINE# def get_markers_for_update( model , old_entity , new_entity ) : #NEWLINE# #INDENT# '\n        Given an old entity state, and the new state, updates the identifiers\n        appropriately. Should be called before saving the new_state\n    ' #NEWLINE# old_ids = set ( unique_identifiers_from_entity ( model , old_entity , ignore_pk = True ) ) #NEWLINE# new_ids = set ( unique_identifiers_from_entity ( model , new_entity , ignore_pk = True ) ) #NEWLINE# to_release = ( old_ids - new_ids ) #NEWLINE# to_acquire = ( new_ids - old_ids ) #NEWLINE# return ( to_acquire , to_release )