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

Method get_history

lib/sqlalchemy/orm/attributes.py:1252–1269  ·  view source on GitHub ↗
(
        self,
        state: InstanceState[Any],
        dict_: Dict[str, Any],
        passive: PassiveFlag = PASSIVE_OFF,
    )

Source from the content-addressed store, hash-verified

1250 raise AttributeError("%s object does not have a value" % self)
1251
1252 def get_history(
1253 self,
1254 state: InstanceState[Any],
1255 dict_: Dict[str, Any],
1256 passive: PassiveFlag = PASSIVE_OFF,
1257 ) -> History:
1258 if self.key in dict_:
1259 return History.from_scalar_attribute(self, state, dict_[self.key])
1260 elif self.key in state.committed_state:
1261 return History.from_scalar_attribute(self, state, NO_VALUE)
1262 else:
1263 if passive & INIT_OK:
1264 passive ^= INIT_OK
1265 current = self.get(state, dict_, passive=passive)
1266 if current is PASSIVE_NO_RESULT:
1267 return HISTORY_BLANK
1268 else:
1269 return History.from_scalar_attribute(self, state, current)
1270
1271 def set(
1272 self,

Callers

nothing calls this directly

Calls 2

from_scalar_attributeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected