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¶
- Getting started — install, hook up your skeletons, call the endpoints.
- Retention — how the daily cleanup decides what to keep.
- Use in the admin — drop-in admin4 component for a point-and-click revision history.
- API reference — generated from the source docstrings (full request/response
shapes included):
RevisionAbstractSkel,RevisionDatabaseAdapter,RevisionModule.