Mongopersist

Latest version: v0.8.4

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.9.0

------------------

- Feature: Allow object state to be stored on the ghost via the
``_p_mongo_state`` attribute. This allows some parent object to control
serialization with lazy loading (most useful for sub-document objects).

- Feature: Allow to store objects using an explicit obejct id, instead of
letting MongoDB generate one for us. The``IdNamesMongoContainer`` class has
been updated to allow not ignore the key while setting items.

- Feature: Support serialization of objects that return a single string from
``__reduce__()``.

- Feature: Added a container-level cache to the ``MongoContainer``
object. This cache is only used within the transaction, but it reduced calls
to Mongo by 40% in a real world use. The cache can be turned off by setting
``mongopersist.zope.container.USE_CONTAINER_CACHE`` to false.

- Feature: Added serializer for ``datetime.time``, since the loaded reduced
state is not usable (due to string to unicode conversion).

- Feature: Added ability for types not to paricipate in circular reference
detection. Mongo-native types already did not participate, but now other
non-persistent types can declarare themselves as "reference-safe" using the
`_m_reference_safe` flag. This is particularly useful for objects serialize
into a set of trivial values that cannot have complex references. (You
should rarely need this feature.)

- Feature: The connection pool client connections now block writes until at
least 2 replications have been successfully been reported (w=3). It used to
be set to w=1, which blocks until master confirms the write.

- Bug: PersistentDict ``__eq__()`` and ``__neq__()`` methods do not rely on
``__cmp__()`` anymore.

- Bug: When a persistent object which is a subobject is modified, on
abort restore the state of the parent object.

- Bug: When a sub-document object is changed and then the main object is
removed, the removed object would re-appear, since the sub-document object
was still registered as changed and caused a write undoing the removal. The
issue was fixed by removing all registered sub-document objects as well from
the list during removal.

- Bug: Objects where compared within the transaction manager for different
reasons. This could create complicated scenarios (including data loss) when
the ``__cmp__()`` method of the object was non-trivial. Now the result of
the ``id(obj)`` function is used to compare objects, which is very save,
since the behavior of this function call cannot be changed for an object.

- Bug: Ensure that only basic types and not objects derived from any basic
type are treated as such.

- Bug: It can happen that comparing similar dicts can cause decode
errors. This in turn caused some object updates to fail in the data manager.

- Bug: ObjectWriter ``get_collection_name()`` now works properly if the object
writer has no jar. This is the case when we simply want to serialize any
object to JSON, but one of the objects is a proper MongoDB persisted object.

- Bug: ``__reduce__()`` may return ``None`` as object state. By handling this
case porperly, sets can now be serialized.

- Bug: Removed objects could return, if they were modified after
removal. Removed objects are now explicitely ignored when registering
modified objects.

- Bug: Make absolutely sure that ``ConflictError`` cannot be raised during
abort when using the ``SerialConflictHandler`` conflict handlers.

- Bug: Fix circular reference detection of non-persistent object that were
different instances but equated.

- Bug: Fixed a bug where shared collection among derived classes would not
work consistently.

- Bug: Fixed a bug during initialization of persistent sub-objects in that
changes would not be seen in the transaction once the datamanger was
flushed.

- Bug: serializing a dict with all-string keys that contained invalid
MongoDB field name characters ('.', '$' or '\0') used to cause an error.

- Bug: Do not let objects, marked with _p_mongo_sub_object be stored separately
from main document they belong to.

0.8.4

------------------

- Bug: Fix insert followed by remove in the same transaction. The document was
not removed from mongo.

- Bug: Fix ``transaction.abort()`` behaviour for complex objects. ``_py_type``
information is not lost after transaction abort.

0.8.3

------------------

- Bug: Fixed ``MongoContainer`` vs ``IdNamesMongoContainer`` ``add`` and
``__setitem__`` behavour on ``None`` keys. ``ObjectAddedEvent`` or
``ObjectMovedEvent`` were not fired because
``zope.container.contained.setitem`` got the just inserted object back.

``MongoContainer`` always requires ``_m_mapping_key`` and uses that attribute
of the object to determine the new key.

``IdNamesMongoContainer`` requires ``_m_mapping_key`` ``None`` and uses
``_id`` to determine the new key.

0.8.2

------------------

- Bug: Fixed ``check_conflict``: make sure we use the same db and collection
as in the object

0.8.1

------------------

- Bug: Fixed ``_p_changed`` setting on object loading which was caused by
assigning directly to ``__name__``. That caused all objects read from
containers to be marked changed on load. That wrecked cache performance too.

0.8.0

------------------

- Feature: Added ``find_objects()`` and ``find_one_object()`` to the collection
wrapper, so that whenever you get a collection from the data manager, you
can load objects directly through the find API.

- Feature: Added the ability for MongoContained objects to fully reference and
load their parents. This allows one to query mongo directly and create the
object from the doc without going through the right container, which you
might not know easily.

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.