Skip to content

viur-revision

Automatic revision tracking and rollback for ViUR skeletons.

viur-revision snapshots the pre-write state of any tracked skeleton into a companion datastore kind (<kind>_revision) on every write. This gives you:

  • Searchable change history — every revision keeps the full entity payload plus the list of bones that changed.
  • One-click rollback — restore any past revision into the live entity; the current state is auto-snapshotted first so the restore can itself be undone.
  • Tiered retention — a daily background task thins the history down to one entry per hour, day, or week depending on age.
  • Per-skel control — track every write or only specific bones; tune the coalescing window that collapses rapid auto-save spam into a single revision.

Quick taste

from viur.revision import RevisionAbstractSkel, RevisionModule

class ExampleSkel(RevisionAbstractSkel, Skeleton):
    revision_fields = ["title", "body"]

class Example(RevisionModule, List):
    ...

That's it. The module now exposes list_revision, view_revision, apply_revision, delete_revision, and a daily retention task — no further wiring required.

Next steps