MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / load_history

Method load_history

lib/sqlalchemy/orm/state.py:1118–1141  ·  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

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
1120 this attribute, via the :class:`.History` interface.
1121
1122 This method **will** emit loader callables if the value of the
1123 attribute is unloaded.
1124
1125 .. note::
1126
1127 The attribute history system tracks changes on a **per flush
1128 basis**. Each time the :class:`.Session` is flushed, the history
1129 of each attribute is reset to empty. The :class:`.Session` by
1130 default autoflushes each time a :class:`_query.Query` is invoked.
1131 For
1132 options on how to control this, see :ref:`session_flushing`.
1133
1134 .. seealso::
1135
1136 :attr:`.AttributeState.history`
1137
1138 :func:`.attributes.get_history` - underlying function
1139
1140 """
1141 return self.state.get_history(self.key, PASSIVE_OFF ^ INIT_OK)
1142
1143
1144class PendingCollection:

Calls 1

get_historyMethod · 0.45