@@ -287,6 +287,9 @@ class AlbumSchema(Schema):
287
287
will be ignored. Use dot delimiters to specify nested fields.
288
288
:param unknown: Whether to exclude, include, or raise an error for unknown
289
289
fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.
290
+ :param propagate_unknown: If ``True``, the value for ``unknown`` will be
291
+ applied to all ``Nested`` fields. Propagates down and allows
292
+ ``Nested`` fields to apply their own ``unknown`` value
290
293
291
294
.. versionchanged:: 3.0.0
292
295
`prefix` parameter removed.
@@ -364,6 +367,10 @@ class Meta:
364
367
- ``dump_only``: Tuple or list of fields to exclude from deserialization
365
368
- ``unknown``: Whether to exclude, include, or raise an error for unknown
366
369
fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.
370
+ - ``propagate_unknown`` If ``True``, the value for ``unknown`` will be
371
+ applied to all ``Nested`` fields. Propagates down, but if a ``Nested``
372
+ field sets ``unknown``, it will begin to propagate that value, not the
373
+ where this is set.
367
374
- ``register``: Whether to register the `Schema` with marshmallow's internal
368
375
class registry. Must be `True` if you intend to refer to this `Schema`
369
376
by class name in `Nested` fields. Only set this to `False` when memory
@@ -619,6 +626,9 @@ def _deserialize(
619
626
will be ignored. Use dot delimiters to specify nested fields.
620
627
:param unknown: Whether to exclude, include, or raise an error for unknown
621
628
fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.
629
+ :param propagate_unknown: If ``True``, the value for ``unknown`` will be
630
+ applied to all ``Nested`` fields. Propagates down and allows
631
+ ``Nested`` fields to apply their own ``unknown`` value
622
632
:param int index: Index of the item being serialized (for storing errors) if
623
633
serializing a collection, otherwise `None`.
624
634
:return: A dictionary of the deserialized data.
@@ -733,6 +743,9 @@ def load(
733
743
:param unknown: Whether to exclude, include, or raise an error for unknown
734
744
fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.
735
745
If `None`, the value for `self.unknown` is used.
746
+ :param propagate_unknown: If ``True``, the value for ``unknown`` will be
747
+ applied to all ``Nested`` fields. Propagates down and allows
748
+ ``Nested`` fields to apply their own ``unknown`` value
736
749
:return: Deserialized data
737
750
738
751
.. versionadded:: 1.0.0
@@ -772,6 +785,9 @@ def loads(
772
785
:param unknown: Whether to exclude, include, or raise an error for unknown
773
786
fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.
774
787
If `None`, the value for `self.unknown` is used.
788
+ :param propagate_unknown: If ``True``, the value for ``unknown`` will be
789
+ applied to all ``Nested`` fields. Propagates down and allows
790
+ ``Nested`` fields to apply their own ``unknown`` value
775
791
:return: Deserialized data
776
792
777
793
.. versionadded:: 1.0.0
@@ -864,6 +880,9 @@ def _do_load(
864
880
:param unknown: Whether to exclude, include, or raise an error for unknown
865
881
fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.
866
882
If `None`, the value for `self.unknown` is used.
883
+ :param propagate_unknown: If ``True``, the value for ``unknown`` will be
884
+ applied to all ``Nested`` fields. Propagates down and allows
885
+ ``Nested`` fields to apply their own ``unknown`` value
867
886
:param postprocess: Whether to run post_load methods..
868
887
:return: Deserialized data
869
888
"""
0 commit comments