🔋 Features:
metadata argument (see #328).🐛 Bug fixes:
None for references, lists and embedded documents
(see #330)._dict_io_validate to propagate IO validation through DictField
(see #335).Other changes:
🔋 Features:
ExposeMissing context manager to return
missing rather than None when dumping. Replace FromUmongoSchema
with RemoveMissingSchema. This schema removes missing fields when dumping
by using ExposeMissing internally. Make this feature opt-in by requiring
the user to specify RemoveMissingSchema as MA_BASE_SCHEMA_CLS.
(see #261)mongo_world parameter from
Schema.as_marshmallow_schema. Schemas generated by this method are meant
to (de)serialize umongo objects, not dict straight from database.
(see #299)umongo.Schema. Schemas should inherit
from umongo.abstract.BaseSchema. Expose RemoveMissingSchema as
umongo.RemoveMissingSchema. (see #301)Other changes:
🔋 Features:
👀 Let Document inherit from EmbeddedDocument (see #266).
➕ Add MixinDocument allowing Document and EmbeddedDocument to
inherit fields and pre/post methods from mixin objects. The mixin class
should appear first (leftmost) in the bases:
class MyDocument(MyMixin, Document). (see #278)
Backwards-incompatible: Remove as_attribute argument of
BaseInstance.register method. Documents can not be accessed by name as
instance attributes anymore. (see #290)
🐛 Bug fixes:
None to a field with _required_validate method
(see #289).🔋 Features:
Backwards-incompatible: Revert broken feature introduced in 3.0.0b6 allowing to get fields from mixin classes (see #273).
Backwards-incompatible: Remove allow_inheritance option. Any
Document or EmbeddedDocument may be subclassed (see #270).
Backwards-incompatible: Field raises DocumentDefinitionError rather
than RuntimeError when passed missing kwarg and Document.commit
raises NotCreatedError when passed conditions for a document that is
not in database (see #275).
🔋 Features:
Backwards-incompatible: abstract in EmbeddedDocument behaves
consistently with Document. The _cls / cls field is only added
on concrete embedded documents subclassing concrete embedded documents. And
EmbeddedField only accepts concrete embedded documents. (see #86)
Document and EmbeddedDocument may inherits from mixin classes. The
mixin class should appear first (leftmost) in the bases:
class MyDocument(MyMixin, Document). (see #188)
Other changes:
import marshmallow as ma. For convenience, missing and
ValidationError can still be imported as umongo.missing and
umongo.ValidationError.🔋 Features:
MA_BASE_SCHEMA_CLS class attribute to
Document and EmbeddedDocument to specify a base class to use in
as_marshmallow_schema. Drop the check_unknown_fields, params and
meta attributes of as_marshmallow_schema. Make mongo_world
kwarg-only. The same effect can be achieved using base schema classes.
This incidentally fixes broken as_marshmallow_schema cache feature.
(see #263)TxMongoDocument.find_with_cursor and
drop support for upstream deprecated find(cursor=True). (see #259).Other changes:
🔋 Features:
Document.pk_field and remove
BaseDataProxy.*_by_mongo_name methods (see #257).🔋 Features:
ReferenceError with
NoneReferenceError. Review the list of exceptions importable from
root umongo module. (see #251)🐛 Bug fixes:
set_by_mongo_name on a field that was not
loaded in a partial load. (see #253)Other changes:
🔋 Features:
🐛 Bug fixes:
🔋 Features:
Instance subclasses for each framework to help users migrating
a database from umongo 2 to umongo 3 (see #319).EmbeddedField to allow passing an embedded document as string before its
registration. Unknown embedded document errors in EmbeddedField are now
detected at runtime, not registration time. Also, indexes are now collected
on first use rather than upon registration and should be accesses through
Document.indexes cached property rather than Document.opts.indexes.
(see #322)BaseSchema ordered. This fixes querying on
embedded documents. Make BaseMarshmallowSchema ordered as well.
(see #323)RemoveMissingSchema opt-out. By default,
generated pure marshmallow schemas now skip missing values from Document
instances rather that returning None. This can be changed by setting
MA_BASE_SCHEMA_CLS. (see #325)