assembl.lib.history_mixin module¶
Mixin classes for keeping old versions of data structures
-
class
assembl.lib.history_mixin.
Dehistoricizer
(*target_classes)[source]¶ Bases:
sqlalchemy.sql.visitors.ReplacingCloningVisitor
remove refs to tombstone_date in an expression
-
class
assembl.lib.history_mixin.
HistoricalProxy
(target, timestamp, assume_in_time=False)[source]¶ Bases:
object
A proxy for base objects, that will wrap an object and related objects with their version at a given time.
-
class
assembl.lib.history_mixin.
HistoryMixin
[source]¶ Bases:
assembl.lib.history_mixin.TombstonableMixin
Mixin class for objects with history
It is possible to take a snapshot of objects of this class to have a record of earlier states. The snapshot is invoked explicitly (through
copy(True)()
), not every time the object is changed. Mainly used for synthesis snapshots.-
copy
(tombstone=None, db=None, **kwargs)[source]¶ Clone object, optionally as tombstone (aka snapshot) reuse base_id. Redefine in subclasses to define arguments
-
property
latest
¶ The latest object in this series; may not be live.
-
property
live
¶ The live version of this object, if any.
-
-
class
assembl.lib.history_mixin.
HistoryMixinWithOrigin
[source]¶ Bases:
assembl.lib.history_mixin.HistoryMixin
,assembl.lib.history_mixin.OriginMixin
-
class
assembl.lib.history_mixin.
TombstonableMixin
[source]¶ Bases:
object
Mixin class for objects that can be tombstoned
These objects can be killed, leaving a tombstone behind, i.e. an inactive row. TODO: Generate a DB view on live objects.
-
class
assembl.lib.history_mixin.
TombstonableOriginMixin
[source]¶ Bases:
assembl.lib.history_mixin.TombstonableMixin
,assembl.lib.history_mixin.OriginMixin