Releases: swisscom/cleanerversion
Bugfix release for admin integration
Added necessary files to CleanerVersion package;
Slightly updated the docs;
Added Django 1.8 compatibility and Django Admin-interface integration
This latest minor release is backward compatible and adds the following features:
- Compatibility with Django 1.8 (LTS); additionally to Django 1.6 and Django 1.7 support has been extended to Django's latest release
- Integration to Django's Admin interface; It is now possible to manage your versions, display an object's history and to filter objects at a given point in time. Credits go to @boydjohnson and @peterfarrell.
- Bugfixes
Bugfix: delete only current objects
This is a bugfix release to ensure that only current objects can be deleted.
Fixed deletion to work in a CleanerVersion-way for Versionables
Versionable objects now only get "soft-deleted" contrary to native Django model instances that continue to be deleted from DB as usual.
Fix deletion collection
Do not collect non-current versions for deletion
Adjust restore() parameter handling
When passing ForeignKeys to restore(), follow Django practice for allowing either objects or ids to be passed.
With an object:
employee.restore(team=new_team)
With an id:
employee.restore(team_id=new_team.id)
restorable versions and more
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.
M2M self-references have been added
It is now possible to auto-reference models through M2M relationships.
No schema adaptions needed.
Bugfix release
Force updating of latest version upon deletion
Historic foreign key pointed versions
New features in this release:
- Possibility to create relationships with non-versioned models
Bugfixes:
- Foreign key relationships now work as intended (returning historic versions), reported in #45