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

Method process_deletes

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

Source from the content-addressed store, hash-verified

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