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

Method get_committed_value

lib/sqlalchemy/orm/attributes.py:1190–1205  ·  view source on GitHub ↗

return the unchanged value of this attribute

(
        self,
        state: InstanceState[Any],
        dict_: _InstanceDict,
        passive: PassiveFlag = PASSIVE_OFF,
    )

Source from the content-addressed store, hash-verified

1188 raise NotImplementedError()
1189
1190 def get_committed_value(
1191 self,
1192 state: InstanceState[Any],
1193 dict_: _InstanceDict,
1194 passive: PassiveFlag = PASSIVE_OFF,
1195 ) -> Any:
1196 """return the unchanged value of this attribute"""
1197
1198 if self.key in state.committed_state:
1199 value = state.committed_state[self.key]
1200 if value is NO_VALUE:
1201 return None
1202 else:
1203 return value
1204 else:
1205 return self.get(state, dict_, passive=passive)
1206
1207 def set_committed_value(self, state, dict_, value):
1208 """set an attribute value on the given instance and 'commit' it."""

Calls 1

getMethod · 0.95

Tested by 1