MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _synchronize

Method _synchronize

lib/sqlalchemy/orm/dependency.py:829–867  ·  view source on GitHub ↗
(
        self,
        state,
        child,
        associationrow,
        clearkeys,
        uowcommit,
        operation=None,
    )

Source from the content-addressed store, hash-verified

827 self._post_update(state, uowcommit, history.sum())
828
829 def _synchronize(
830 self,
831 state,
832 child,
833 associationrow,
834 clearkeys,
835 uowcommit,
836 operation=None,
837 ):
838 if state is None or (
839 not self.post_update and uowcommit.is_deleted(state)
840 ):
841 return
842
843 if (
844 operation is not None
845 and child is not None
846 and not uowcommit.session._contains_state(child)
847 ):
848 util.warn(
849 "Object of type %s not in session, %s "
850 "operation along '%s' won't proceed"
851 % (mapperutil.state_class_str(child), operation, self.prop)
852 )
853 return
854
855 if clearkeys or child is None:
856 sync._clear(state, self.parent, self.prop.synchronize_pairs)
857 else:
858 self._verify_canload(child)
859 sync._populate(
860 child,
861 self.mapper,
862 state,
863 self.parent,
864 self.prop.synchronize_pairs,
865 uowcommit,
866 False,
867 )
868
869
870class _DetectKeySwitch(_DependencyProcessor):

Callers 2

process_deletesMethod · 0.95
process_savesMethod · 0.95

Calls 5

is_deletedMethod · 0.80
_contains_stateMethod · 0.80
_verify_canloadMethod · 0.80
warnMethod · 0.45
_clearMethod · 0.45

Tested by

no test coverage detected