MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / history

Method history

lib/sqlalchemy/orm/state.py:1091–1116  ·  view source on GitHub ↗

Return the current **pre-flush** change history for this attribute, via the :class:`.History` interface. This method will **not** emit loader callables if the value of the attribute is unloaded. .. note:: The attribute history system tracks changes on a

(self)

Source from the content-addressed store, hash-verified

1089
1090 @property
1091 def history(self) -> History:
1092 """Return the current **pre-flush** change history for
1093 this attribute, via the :class:`.History` interface.
1094
1095 This method will **not** emit loader callables if the value of the
1096 attribute is unloaded.
1097
1098 .. note::
1099
1100 The attribute history system tracks changes on a **per flush
1101 basis**. Each time the :class:`.Session` is flushed, the history
1102 of each attribute is reset to empty. The :class:`.Session` by
1103 default autoflushes each time a :class:`_query.Query` is invoked.
1104 For
1105 options on how to control this, see :ref:`session_flushing`.
1106
1107
1108 .. seealso::
1109
1110 :meth:`.AttributeState.load_history` - retrieve history
1111 using loader callables if the value is not locally present.
1112
1113 :func:`.attributes.get_history` - underlying function
1114
1115 """
1116 return self.state.get_history(self.key, PASSIVE_NO_INITIALIZE)
1117
1118 def load_history(self) -> History:
1119 """Return the current **pre-flush** change history for

Callers

nothing calls this directly

Calls 1

get_historyMethod · 0.45

Tested by

no test coverage detected