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