class documentation

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_collection Undocumented
Class Method from_object_attribute Undocumented
Class Method from_scalar_attribute Undocumented
Method __bool__ Undocumented
Method as_state Undocumented
Method empty Return True if this :class:`.History` has no changes and no existing, unchanged state.
Method has_changes Return True if this :class:`.History` has changes.
Method non_added Return a collection of unchanged + deleted.
Method non_deleted 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
@classmethod
def from_collection(cls, attribute: CollectionAttributeImpl, state: InstanceState[Any], current: Any) -> History: (source)

Undocumented

@classmethod
def from_object_attribute(cls, attribute: ScalarObjectAttributeImpl, state: InstanceState[Any], current: Any, original: Any = _NO_HISTORY) -> History: (source)

Undocumented

@classmethod
def from_scalar_attribute(cls, attribute: ScalarAttributeImpl, state: InstanceState[Any], current: Any) -> History: (source)

Undocumented

def __bool__(self) -> bool: (source)

Undocumented

def as_state(self) -> History: (source)

Undocumented

def empty(self) -> bool: (source)

Return True if this :class:`.History` has no changes and no existing, unchanged state.

def has_changes(self) -> bool: (source)

Return True if this :class:`.History` has changes.

def non_added(self) -> Sequence[Any]: (source)

Return a collection of unchanged + deleted.

def non_deleted(self) -> Sequence[Any]: (source)

Return a collection of added + unchanged.

def sum(self) -> Sequence[Any]: (source)

Return a collection of added + unchanged + deleted.

Undocumented

Undocumented

unchanged: Union[Tuple[], List[Any]] = (source)

Undocumented