MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / process_deletes

Method process_deletes

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

Source from the content-addressed store, hash-verified

789 uowcommit.register_object(st_, isdelete=True)
790
791 def process_deletes(self, uowcommit, states):
792 if (
793 self.post_update
794 and not self.cascade.delete_orphan
795 and not self.passive_deletes == "all"
796 ):
797 # post_update means we have to update our
798 # row to not reference the child object
799 # before we can DELETE the row
800 for state in states:
801 self._synchronize(state, None, None, True, uowcommit)
802 if state and self.post_update:
803 history = uowcommit.get_attribute_history(
804 state, self.key, self._passive_delete_flag
805 )
806 if history:
807 self._post_update(
808 state, uowcommit, history.sum(), is_m2o_delete=True
809 )
810
811 def process_saves(self, uowcommit, states):
812 for state in states:

Callers

nothing calls this directly

Calls 4

_synchronizeMethod · 0.95
get_attribute_historyMethod · 0.80
_post_updateMethod · 0.80
sumMethod · 0.45

Tested by

no test coverage detected