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

Method load_history

lib/sqlalchemy/orm/state.py:1111–1134  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

1109 return self.state.get_history(self.key, PASSIVE_NO_INITIALIZE)
1110
1111 def load_history(self) -> History:
1112 """Return the current **pre-flush** change history for
1113 this attribute, via the :class:`.History` interface.
1114
1115 This method **will** emit loader callables if the value of the
1116 attribute is unloaded.
1117
1118 .. note::
1119
1120 The attribute history system tracks changes on a **per flush
1121 basis**. Each time the :class:`.Session` is flushed, the history
1122 of each attribute is reset to empty. The :class:`.Session` by
1123 default autoflushes each time a :class:`_query.Query` is invoked.
1124 For
1125 options on how to control this, see :ref:`session_flushing`.
1126
1127 .. seealso::
1128
1129 :attr:`.AttributeState.history`
1130
1131 :func:`.attributes.get_history` - underlying function
1132
1133 """
1134 return self.state.get_history(self.key, PASSIVE_OFF ^ INIT_OK)
1135
1136
1137class PendingCollection:

Calls 1

get_historyMethod · 0.45