Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

restorable versions and more

Compare
Choose a tag to compare
@brki brki released this 23 Apr 10:02
· 281 commits to master since this release

Deletion handling has changed. Previously, VersionedForeignKey on_delete handlers were ignored. Cascade (the default), protect, and other on_delete handlers now take effect for VersionedForeignKeys. See the CleanerVersion docs for the behaviour details.

Versionable.restore() is added to allow restoring previous versions (without relations).

Versionable.detach() is added to allow giving an existing object.

It is possible to specify an id yourself when creating a new Versionable (but beware: all sources that are generating uuids should have sufficient entropy if UUID collisions are to be avoided).

VersionManager.previous_version() and VersionManager.next_version() now default to returning object's whose as_of time is set to one microsecond before the version's end date. This affects when the relations are returned if relations are traversed via the returned object. See CleanerVersion docs for available alternative behaviours.