- Moving CI to github actions
- Added python 3.8, 3.9, 3.10, 3.11
- Make sure we can not update an outdated object again in __im_update__
- Added enum.Enum as immutable type / constant. This allows assigning an Enum to a ImmutableBase attribute.
- Allow
defaultInfo()
decorator to be nested.
- IMPORTANT: Add immutable state as a column to the table. This will require a migration of your database schema and data.
- Introduced new
IM_STATE_DELETED
state which marks an object as deleted. - Add new
_pj_with_deleted_items
flag that when set will change the container API to return deleted items as well. - Added
ImmutableContainer.withDeletedItems()
method that will clone the container and set the_pj_with_deleted_items
flag. That will by definition reset all caches to prohibit inconsistent results. - The
test_functional_deletionAndRevival()
demonstrates the deletion and revivial functionality.
- Honor the
_pj_remove_documents
flag in the pjpersistImmutableContainer
by simply marking the last version of the object as retired and assigning an end date. This way deletions can be undone. Also, audit logs can now be complete. - Allow the creator and comment to be specified globally, so that APIs don't have to carry that information through all the layers.
- Make sure that ImmutableContainer does not accept transient objects. This is particularly important since objects can be initialized in transient state when not using the create() context manager. It also protects the object from being updated in a container before completing its update.
- Refactored __delitem__ tests to be more minimal and document the use cases more clearly.
- 1.4.1 was a brown bag release.
- Missed to re-export shoobx.immutable.immutable.create
Changed the pattern of creating an immutable object to a context manager. NOTE, just creating an object like Immutable() will give you a transient object. The preferred pattern is:
>>> import shoobx.immutable as im >>> with im.create(im.Immutable) as factory: ... imObj = factory()
This makes it way easier to set initial attributes. See README.rst and docs and tests for details.
- Fixing leftover _pj_get_resolve_filter occurrences in ImmutableContainer
Fix ImmutableContainer.__delitem__ : In order to delete all revisions of an object, the delete method used an internal super() call to get query filters. That ended up ignoring subclass filters causing deletes across contianer boundaries.
As a solution, a new _pj_get_resolve_filter_all_versions method has been introduced to return a query for all versions within a container. The _pj_get_resolve_filter method now uses the other one and simply adds the "latest version" constraint. All sub-containers should now override _pj_get_resolve_filter_all_versions instead of _pj_get_resolve_filter.
- Fix ImmutableContainer.__delitem__ : it did not remove revisions of the deleted object
- Fix ImmutableContainer.rollbackToRevision : it rolled back ALL objects to the given revision
Extended IRevisionedImmutableManager to support efficient version management.
Added getNumberOfRevisions(obj) method to return the number of revisions available for a given object. Note that this does not necessarily equal to the latest revision number.
Exended getRevisionHistory() with multiple new arguments to support filtering, sorting and batching:
Filter Arguments:
- creator: The creator of the revision must match the argument.
- comment: The comment must contain the argument as a substring.
- startBefore: The revision must start before the given date/time.
- startAfter: The revision must start after the given date/time.
Ordering Arguments:
- reversed: When true, the history will be return in reverse
- chronological order, specifically the latest revision is listed first.
Batching Arguments:
- batchStart: The index at which to start the batch.
- batchSize: The size the of the batch. It is thus the max length of
- the iterable.
Provided an implementation of the new arguments for both the simple revision manage and the pjpersist container.
Declare that ImmutableContainer implements IRevisionedImmutableManager.
Increased test coverage back to 100%.
- Added datetime classes as system immutable types.
- Introduced __im_version__ to IRevisionedImmutable and use it instead of timestamps to create a chronological order of revisions. (Timestamps might be slightly different accross servers and cause bad history.)
- Do not duplicate implementation of __im_update__() in RevisionedImmutableBase. Use __im_[before|after]_update__() to do all revision-related tasks.
- Tweak copy() implementation for ImmutableList and ImmutableDict.
- Properly implement ImmutableDict.fromkeys().
- Fix ImmutableList.copy() to just work when locked. This allows for only making a shallow clone, since any update will cause a deep copy and thus immutability is guaranteed.
- Implemented ImmutableDict.copy(). Raise error on ImmutableDict.fromkeys().
- ImmutableContainer also needs an updated _pj_column_fields list.
- Minor test fixes.
- Minor documentation fixes and code comment enhancements.
- Add API documentation.
- Moved documentation to Read the Docs.
- Add some readable documentation.
- Added high-level shoobx.immutable.update(im, *args, **kw) function.
- Implemented __repr__() for ImmutableSet to mimic behavior of ImmutableDict and ImmutableList.
- Fix package description.
- Immutable Types, Immutable Dict, Immutable Set, Immutable List
- Revisioned Immutable with Revision Manager sample implementation
- Optional: pjpersist support for immutables. Requires pjpersist>=1.7.0.
- Initial Release