Skip to content

Commit

Permalink
Update docstrings and HISTORY.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Sep 11, 2020
1 parent ffea698 commit f691b35
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
15 changes: 15 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ History
Features:

* Add support for motor 2.2 (see #294). (Picked from 2.3.0.)
* *Backwards-incompatible*: Add ``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)
* *Backwards-incompatible*: Remove ``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)

Other changes:

* *Backwards-incompatible*: Drop Python 3.6 support (see #298).


3.0.0b8 (2020-07-22)
--------------------
Expand Down
5 changes: 3 additions & 2 deletions umongo/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

class RemoveMissingSchema(ma.Schema):
"""
Custom :class:`marshmallow.Schema` subclass returning missing rather than
None for missing fields in umongo :class:`umongo.Document`s.
Custom :class:`marshmallow.Schema` subclass that skips missing fields
rather than returning None for missing fields when dumping umongo
:class:`umongo.Document`s.
"""
def dump(self, *args, **kwargs):
with ExposeMissing():
Expand Down

0 comments on commit f691b35

Please sign in to comment.