MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _source_modified

Function _source_modified

lib/sqlalchemy/orm/sync.py:126–142  ·  view source on GitHub ↗

return true if the source object has changes from an old to a new value on the given synchronize pairs

(uowcommit, source, source_mapper, synchronize_pairs)

Source from the content-addressed store, hash-verified

124
125
126def _source_modified(uowcommit, source, source_mapper, synchronize_pairs):
127 """return true if the source object has changes from an old to a
128 new value on the given synchronize pairs
129
130 """
131 for l, r in synchronize_pairs:
132 try:
133 prop = source_mapper._columntoproperty[l]
134 except exc.UnmappedColumnError as err:
135 _raise_col_to_prop(False, source_mapper, l, None, r, err)
136 history = uowcommit.get_attribute_history(
137 source, prop.key, PassiveFlag.PASSIVE_NO_INITIALIZE
138 )
139 if bool(history.deleted):
140 return True
141 else:
142 return False
143
144
145def _raise_col_to_prop(

Callers

nothing calls this directly

Calls 2

_raise_col_to_propFunction · 0.85
get_attribute_historyMethod · 0.80

Tested by

no test coverage detected