class History(NamedTuple): (source)
A 3-tuple of added, unchanged and deleted values, representing the changes which have occurred on an instrumented attribute. The easiest way to get a :class:`.History` object for a particular attribute on an object is to use the :func:`_sa.inspect` function:: from sqlalchemy import inspect hist = inspect(myobject).attrs.myattribute.history Each tuple member is an iterable sequence: * ``added`` - the collection of items added to the attribute (the first tuple element). * ``unchanged`` - the collection of items that have not changed on the attribute (the second tuple element). * ``deleted`` - the collection of items that have been removed from the attribute (the third tuple element).
Class Method | from |
Undocumented |
Class Method | from |
Undocumented |
Class Method | from |
Undocumented |
Method | __bool__ |
Undocumented |
Method | as |
Undocumented |
Method | empty |
Return True if this :class:`.History` has no changes and no existing, unchanged state. |
Method | has |
Return True if this :class:`.History` has changes. |
Method | non |
Return a collection of unchanged + deleted. |
Method | non |
Return a collection of added + unchanged. |
Method | sum |
Return a collection of added + unchanged + deleted. |
Class Variable | added |
Undocumented |
Class Variable | deleted |
Undocumented |
Class Variable | unchanged |
Undocumented |
def from_collection(cls, attribute:
CollectionAttributeImpl
, state: InstanceState[ Any]
, current: Any
) -> History
:
(source)
¶
Undocumented
def from_object_attribute(cls, attribute:
ScalarObjectAttributeImpl
, state: InstanceState[ Any]
, current: Any
, original: Any
= _NO_HISTORY) -> History
:
(source)
¶
Undocumented
def from_scalar_attribute(cls, attribute:
ScalarAttributeImpl
, state: InstanceState[ Any]
, current: Any
) -> History
:
(source)
¶
Undocumented