MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _organize_states_for_delete

Function _organize_states_for_delete

lib/sqlalchemy/orm/persistence.py:302–322  ·  view source on GitHub ↗

Make an initial pass across a set of states for DELETE. This includes calling out before_delete and obtaining key information for each state including its dictionary, mapper, the connection to use for the execution per state.

(base_mapper, states, uowtransaction)

Source from the content-addressed store, hash-verified

300
301
302def _organize_states_for_delete(base_mapper, states, uowtransaction):
303 """Make an initial pass across a set of states for DELETE.
304
305 This includes calling out before_delete and obtaining
306 key information for each state including its dictionary,
307 mapper, the connection to use for the execution per state.
308
309 """
310 for state, dict_, mapper, connection in _connections_for_states(
311 base_mapper, uowtransaction, states
312 ):
313 mapper.dispatch.before_delete(mapper, connection, state)
314
315 if mapper.version_id_col is not None:
316 update_version_id = mapper._get_committed_state_attr_by_column(
317 state, dict_, mapper.version_id_col
318 )
319 else:
320 update_version_id = None
321
322 yield (state, dict_, mapper, connection, update_version_id)
323
324
325def _collect_insert_commands(

Callers 1

_delete_objFunction · 0.85

Calls 3

_connections_for_statesFunction · 0.85
before_deleteMethod · 0.80

Tested by

no test coverage detected