MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / process_deletes

Method process_deletes

lib/sqlalchemy/orm/dependency.py:1082–1120  ·  view source on GitHub ↗
(self, uowcommit, states)

Source from the content-addressed store, hash-verified

1080 uowcommit.register_object(st_, isdelete=True)
1081
1082 def process_deletes(self, uowcommit, states):
1083 secondary_delete = []
1084 secondary_insert = []
1085 secondary_update = []
1086
1087 processed = self._get_reversed_processed_set(uowcommit)
1088 tmp = set()
1089 for state in states:
1090 # this history should be cached already, as
1091 # we loaded it in preprocess_deletes
1092 history = uowcommit.get_attribute_history(
1093 state, self.key, self._passive_delete_flag
1094 )
1095 if history:
1096 for child in history.non_added():
1097 if child is None or (
1098 processed is not None and (state, child) in processed
1099 ):
1100 continue
1101 associationrow = {}
1102 if not self._synchronize(
1103 state,
1104 child,
1105 associationrow,
1106 False,
1107 uowcommit,
1108 "delete",
1109 ):
1110 continue
1111 secondary_delete.append(associationrow)
1112
1113 tmp.update((c, state) for c in history.non_added())
1114
1115 if processed is not None:
1116 processed.update(tmp)
1117
1118 self._run_crud(
1119 uowcommit, secondary_insert, secondary_update, secondary_delete
1120 )
1121
1122 def process_saves(self, uowcommit, states):
1123 secondary_delete = []

Callers

nothing calls this directly

Calls 7

_synchronizeMethod · 0.95
_run_crudMethod · 0.95
get_attribute_historyMethod · 0.80
non_addedMethod · 0.80
appendMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected