class History(util.namedtuple('History', ['added', 'unchanged', 'deleted'])):
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 .History
object for a particular
attribute on an object is to use the _sa.inspect
function:
from sqlalchemy import inspect hist = inspect(myobject).attrs.myattribute.history
Each tuple member is an iterable sequence:
Class Method | from_collection |
Undocumented |
Class Method | from_object_attribute |
Undocumented |
Class Method | from_scalar_attribute |
Undocumented |
Method | empty |
Return True if this .History has no changes and no existing, unchanged state. |
Method | has_changes |
Return True if this .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. |
Method | __bool__ |
Undocumented |
Method | as_state |
Undocumented |