marshmallow 4.0.0__tar.gz → 4.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {marshmallow-4.0.0 → marshmallow-4.0.1}/CHANGELOG.rst +12 -5
- {marshmallow-4.0.0 → marshmallow-4.0.1}/CONTRIBUTING.rst +1 -2
- {marshmallow-4.0.0 → marshmallow-4.0.1}/PKG-INFO +3 -3
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/conf.py +1 -2
- {marshmallow-4.0.0 → marshmallow-4.0.1}/pyproject.toml +3 -3
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/__init__.py +0 -1
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/exceptions.py +0 -1
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/fields.py +7 -5
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/orderedset.py +1 -1
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/schema.py +4 -4
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/utils.py +0 -1
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/base.py +0 -11
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_decorators.py +1 -1
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_registry.py +3 -3
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_serialization.py +2 -2
- {marshmallow-4.0.0 → marshmallow-4.0.1}/LICENSE +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/NOTICE +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/README.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/SECURITY.md +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/.gitignore +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/_static/apple-touch-icon.png +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/_static/custom.css +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/_static/favicon.ico +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/_static/marshmallow-logo-200.png +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/_static/marshmallow-logo-with-title-for-dark-theme.png +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/_static/marshmallow-logo-with-title.png +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/_static/marshmallow-logo.png +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/api_reference.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/authors.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/changelog.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/code_of_conduct.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/contributing.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/custom_fields.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/dashing.json +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/donate.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/examples/index.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/examples/inflection.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/examples/quotes_api.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/examples/validating_package_json.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/extending/custom_error_handling.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/extending/custom_error_messages.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/extending/custom_options.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/extending/index.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/extending/overriding_attribute_access.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/extending/pre_and_post_processing_methods.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/extending/schema_validation.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/extending/using_original_input_data.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/index.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/install.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/kudos.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/license.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/marshmallow.class_registry.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/marshmallow.decorators.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/marshmallow.error_store.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/marshmallow.exceptions.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/marshmallow.experimental.context.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/marshmallow.fields.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/marshmallow.schema.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/marshmallow.types.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/marshmallow.utils.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/marshmallow.validate.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/nesting.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/quickstart.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/top_level.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/upgrading.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/whos_using.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/docs/why.rst +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/class_registry.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/constants.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/decorators.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/error_store.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/experimental/__init__.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/experimental/context.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/py.typed +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/types.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/src/marshmallow/validate.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/__init__.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/conftest.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/foo_serializer.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/mypy_test_cases/test_class_registry.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/mypy_test_cases/test_schema.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/mypy_test_cases/test_validation_error.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_context.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_deserialization.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_error_store.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_exceptions.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_fields.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_options.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_schema.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_utils.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tests/test_validate.py +0 -0
- {marshmallow-4.0.0 → marshmallow-4.0.1}/tox.ini +0 -0
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
---------
|
|
3
3
|
|
|
4
|
+
4.0.1 (2025-08-28)
|
|
5
|
+
++++++++++++++++++
|
|
6
|
+
|
|
7
|
+
Bug fixes:
|
|
8
|
+
|
|
9
|
+
- Fix wildcard import of ``from marshmallow import *`` (:pr:`2823`).
|
|
10
|
+
Thanks :user:`Florian-Laport` for the PR.
|
|
11
|
+
|
|
12
|
+
|
|
4
13
|
4.0.0 (2025-04-16)
|
|
5
14
|
******************
|
|
6
15
|
|
|
@@ -22,16 +31,14 @@ Other changes:
|
|
|
22
31
|
|
|
23
32
|
- Typing: `Field <marshmallow.fields.Field>` is now a generic type with a type argument for the internal value type.
|
|
24
33
|
- `marshmallow.fields.UUID` no longer subclasses `marshmallow.fields.String`.
|
|
25
|
-
-
|
|
26
|
-
- `marshmallow.Schema.load` no longer silently fails to call schema validators when a generator is passed (:issue:`1898`).
|
|
34
|
+
- `marshmallow.Schema.load` no longer silently fails to call schema validators when a generator is passed (:issue:`1898`).
|
|
27
35
|
The typing of `data` is also updated to be more accurate.
|
|
28
36
|
Thanks :user:`ziplokk1` for reporting.
|
|
29
|
-
|
|
37
|
+
- *Backwards-incompatible*: Use `datetime.date.fromisoformat`, `datetime.time.fromisoformat`, and `datetime.datetime.fromisoformat` from the standard library to deserialize dates, times and datetimes (:pr:`2078`).
|
|
30
38
|
As a consequence of this change:
|
|
31
39
|
- Time with time offsets are now supported.
|
|
32
40
|
- YYYY-MM-DD is now accepted as a datetime and deserialized as naive 00:00 AM.
|
|
33
41
|
- `from_iso_date`, `from_iso_time` and `from_iso_datetime` are removed from `marshmallow.utils`.
|
|
34
|
-
|
|
35
42
|
- Remove `isoformat`, `to_iso_time` and `to_iso_datetime` from `marshmallow.utils` (:pr:`2766`).
|
|
36
43
|
- Remove `from_rfc`, and `rfcformat` from `marshmallow.utils` (:pr:`2767`).
|
|
37
44
|
- Remove `is_keyed_tuple` from `marshmallow.utils` (:pr:`2768`).
|
|
@@ -152,7 +159,7 @@ Features:
|
|
|
152
159
|
|
|
153
160
|
Bug fixes:
|
|
154
161
|
|
|
155
|
-
- Respect ``data_key`` when schema validators raise a `ValidationError <marshmallow.exceptions.ValidationError>`
|
|
162
|
+
- Respect ``data_key`` when schema validators raise a `ValidationError <marshmallow.exceptions.ValidationError>`
|
|
156
163
|
with a ``field_name`` argument (:issue:`2170`). Thanks :user:`matejsp` for reporting.
|
|
157
164
|
- Correctly handle multiple `@post_load <marshmallow.post_load>` methods where one method appends to
|
|
158
165
|
the data and another passes ``pass_original=True`` (:issue:`1755`).
|
|
@@ -26,8 +26,7 @@ Ways to contribute
|
|
|
26
26
|
|
|
27
27
|
- Comment on some of marshmallow's `open issues <https://github.com/marshmallow-code/marshmallow/issues>`_ (especially those `labeled "feedback welcome" <https://github.com/marshmallow-code/marshmallow/issues?q=is%3Aopen+is%3Aissue+label%3A%22feedback+welcome%22>`_). Share a solution or workaround. Make a suggestion for how a feature can be made better. Opinions are welcome!
|
|
28
28
|
- Improve `the docs <https://marshmallow.readthedocs.io>`_.
|
|
29
|
-
For straightforward edits,
|
|
30
|
-
click the ReadTheDocs menu button in the bottom-right corner of the page and click "Edit".
|
|
29
|
+
For straightforward edits, click the edit button in the top-right corner of the page.
|
|
31
30
|
See the :ref:`Documentation <contributing_documentation>` section of this page if you want to build the docs locally.
|
|
32
31
|
- If you think you've found a bug, `open an issue <https://github.com/marshmallow-code/marshmallow/issues>`_.
|
|
33
32
|
- Contribute an :ref:`example usage <contributing_examples>` of marshmallow.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: marshmallow
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.1
|
|
4
4
|
Summary: A lightweight library for converting complex datatypes to and from native Python datatypes.
|
|
5
5
|
Author-email: Steven Loria <sloria1@gmail.com>
|
|
6
6
|
Maintainer-email: Steven Loria <sloria1@gmail.com>, Jérôme Lafréchoux <jerome@jolimont.fr>, Jared Deckard <jared@shademaps.com>
|
|
@@ -22,11 +22,11 @@ Requires-Dist: marshmallow[tests] ; extra == "dev"
|
|
|
22
22
|
Requires-Dist: tox ; extra == "dev"
|
|
23
23
|
Requires-Dist: pre-commit>=3.5,<5.0 ; extra == "dev"
|
|
24
24
|
Requires-Dist: autodocsumm==0.2.14 ; extra == "docs"
|
|
25
|
-
Requires-Dist: furo==
|
|
25
|
+
Requires-Dist: furo==2025.7.19 ; extra == "docs"
|
|
26
26
|
Requires-Dist: sphinx-copybutton==0.5.2 ; extra == "docs"
|
|
27
27
|
Requires-Dist: sphinx-issues==5.0.1 ; extra == "docs"
|
|
28
28
|
Requires-Dist: sphinx==8.2.3 ; extra == "docs"
|
|
29
|
-
Requires-Dist: sphinxext-opengraph==0.
|
|
29
|
+
Requires-Dist: sphinxext-opengraph==0.12.0 ; extra == "docs"
|
|
30
30
|
Requires-Dist: pytest ; extra == "tests"
|
|
31
31
|
Requires-Dist: simplejson ; extra == "tests"
|
|
32
32
|
Project-URL: Changelog, https://marshmallow.readthedocs.io/en/latest/changelog.html
|
|
@@ -37,7 +37,6 @@ html_theme_options = {
|
|
|
37
37
|
"light_logo": "marshmallow-logo-with-title.png",
|
|
38
38
|
"dark_logo": "marshmallow-logo-with-title-for-dark-theme.png",
|
|
39
39
|
"source_repository": "https://github.com/marshmallow-code/marshmallow",
|
|
40
|
-
"announcement": 'This is the documentation for the unreleased 4.0 version. The latest v3 docs are <a href="https://marshmallow.readthedocs.io/en/3.x-line/">here</a>.',
|
|
41
40
|
"source_branch": "dev",
|
|
42
41
|
"source_directory": "docs/",
|
|
43
42
|
"sidebar_hide_name": True,
|
|
@@ -45,7 +44,7 @@ html_theme_options = {
|
|
|
45
44
|
# Serif system font stack: https://systemfontstack.com/
|
|
46
45
|
"font-stack": "Iowan Old Style, Apple Garamond, Baskerville, Times New Roman, Droid Serif, Times, Source Serif Pro, serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;",
|
|
47
46
|
},
|
|
48
|
-
"top_of_page_buttons": ["view"],
|
|
47
|
+
"top_of_page_buttons": ["view", "edit"],
|
|
49
48
|
}
|
|
50
49
|
pygments_dark_style = "lightbulb"
|
|
51
50
|
html_favicon = "_static/favicon.ico"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "marshmallow"
|
|
3
|
-
version = "4.0.
|
|
3
|
+
version = "4.0.1"
|
|
4
4
|
description = "A lightweight library for converting complex datatypes to and from native Python datatypes."
|
|
5
5
|
readme = "README.rst"
|
|
6
6
|
license = { file = "LICENSE" }
|
|
@@ -37,11 +37,11 @@ Tidelift = "https://tidelift.com/subscription/pkg/pypi-marshmallow?utm_source=py
|
|
|
37
37
|
[project.optional-dependencies]
|
|
38
38
|
docs = [
|
|
39
39
|
"autodocsumm==0.2.14",
|
|
40
|
-
"furo==
|
|
40
|
+
"furo==2025.7.19",
|
|
41
41
|
"sphinx-copybutton==0.5.2",
|
|
42
42
|
"sphinx-issues==5.0.1",
|
|
43
43
|
"sphinx==8.2.3",
|
|
44
|
-
"sphinxext-opengraph==0.
|
|
44
|
+
"sphinxext-opengraph==0.12.0",
|
|
45
45
|
]
|
|
46
46
|
tests = ["pytest", "simplejson"]
|
|
47
47
|
dev = ["marshmallow[tests]", "tox", "pre-commit>=3.5,<5.0"]
|
|
@@ -20,7 +20,6 @@ class ValidationError(MarshmallowError):
|
|
|
20
20
|
:param message: An error message, list of error messages, or dict of
|
|
21
21
|
error messages. If a dict, the keys are subitems and the values are error messages.
|
|
22
22
|
:param field_name: Field name to store the error on.
|
|
23
|
-
If `None`, the error is stored as schema-level error.
|
|
24
23
|
:param data: Raw input data.
|
|
25
24
|
:param valid_data: Valid (de)serialized data.
|
|
26
25
|
"""
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ruff: noqa:
|
|
1
|
+
# ruff: noqa: SLF001
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
4
|
import abc
|
|
@@ -530,7 +530,7 @@ class Nested(Field):
|
|
|
530
530
|
else:
|
|
531
531
|
nested = typing.cast("Schema", self.nested)
|
|
532
532
|
# defer the import of `marshmallow.schema` to avoid circular imports
|
|
533
|
-
from marshmallow.schema import Schema
|
|
533
|
+
from marshmallow.schema import Schema # noqa: PLC0415
|
|
534
534
|
|
|
535
535
|
if isinstance(nested, dict):
|
|
536
536
|
nested = Schema.from_dict(nested)
|
|
@@ -558,7 +558,7 @@ class Nested(Field):
|
|
|
558
558
|
f"`Schema`, not {nested.__class__}."
|
|
559
559
|
)
|
|
560
560
|
else:
|
|
561
|
-
schema_class = class_registry.get_class(nested, all=False)
|
|
561
|
+
schema_class = class_registry.get_class(nested, all=False) # type: ignore[unreachable]
|
|
562
562
|
self._schema = schema_class(
|
|
563
563
|
many=self.many,
|
|
564
564
|
only=self.only,
|
|
@@ -591,7 +591,9 @@ class Nested(Field):
|
|
|
591
591
|
raise self.make_error("type", input=value, type=value.__class__.__name__)
|
|
592
592
|
|
|
593
593
|
def _load(
|
|
594
|
-
self,
|
|
594
|
+
self,
|
|
595
|
+
value: typing.Any,
|
|
596
|
+
partial: bool | types.StrSequenceOrSet | None = None, # noqa: FBT001
|
|
595
597
|
):
|
|
596
598
|
try:
|
|
597
599
|
valid_data = self.schema.load(value, unknown=self.unknown, partial=partial)
|
|
@@ -606,7 +608,7 @@ class Nested(Field):
|
|
|
606
608
|
value: typing.Any,
|
|
607
609
|
attr: str | None,
|
|
608
610
|
data: typing.Mapping[str, typing.Any] | None,
|
|
609
|
-
partial: bool | types.StrSequenceOrSet | None = None,
|
|
611
|
+
partial: bool | types.StrSequenceOrSet | None = None, # noqa: FBT001
|
|
610
612
|
**kwargs,
|
|
611
613
|
):
|
|
612
614
|
"""Same as :meth:`Field._deserialize` with additional ``partial`` argument.
|
|
@@ -550,7 +550,7 @@ class Schema(metaclass=SchemaMeta):
|
|
|
550
550
|
:return: Serialized data
|
|
551
551
|
|
|
552
552
|
.. versionchanged:: 3.0.0b7
|
|
553
|
-
This method returns the serialized data rather than a ``(data, errors)``
|
|
553
|
+
This method returns the serialized data rather than a ``(data, errors)`` tuple.
|
|
554
554
|
A :exc:`ValidationError <marshmallow.exceptions.ValidationError>` is raised
|
|
555
555
|
if ``obj`` is invalid.
|
|
556
556
|
.. versionchanged:: 3.0.0rc9
|
|
@@ -582,7 +582,7 @@ class Schema(metaclass=SchemaMeta):
|
|
|
582
582
|
:return: A ``json`` string
|
|
583
583
|
|
|
584
584
|
.. versionchanged:: 3.0.0b7
|
|
585
|
-
This method returns the serialized data rather than a ``(data, errors)``
|
|
585
|
+
This method returns the serialized data rather than a ``(data, errors)`` tuple.
|
|
586
586
|
A :exc:`ValidationError <marshmallow.exceptions.ValidationError>` is raised
|
|
587
587
|
if ``obj`` is invalid.
|
|
588
588
|
"""
|
|
@@ -723,7 +723,7 @@ class Schema(metaclass=SchemaMeta):
|
|
|
723
723
|
:return: Deserialized data
|
|
724
724
|
|
|
725
725
|
.. versionchanged:: 3.0.0b7
|
|
726
|
-
This method returns the deserialized data rather than a ``(data, errors)``
|
|
726
|
+
This method returns the deserialized data rather than a ``(data, errors)`` tuple.
|
|
727
727
|
A :exc:`ValidationError <marshmallow.exceptions.ValidationError>` is raised
|
|
728
728
|
if invalid data are passed.
|
|
729
729
|
"""
|
|
@@ -757,7 +757,7 @@ class Schema(metaclass=SchemaMeta):
|
|
|
757
757
|
:return: Deserialized data
|
|
758
758
|
|
|
759
759
|
.. versionchanged:: 3.0.0b7
|
|
760
|
-
This method returns the deserialized data rather than a ``(data, errors)``
|
|
760
|
+
This method returns the deserialized data rather than a ``(data, errors)`` tuple.
|
|
761
761
|
A :exc:`ValidationError <marshmallow.exceptions.ValidationError>` is raised
|
|
762
762
|
if invalid data are passed.
|
|
763
763
|
.. versionchanged:: 4.0.0
|
|
@@ -161,17 +161,6 @@ class Blog:
|
|
|
161
161
|
return item.name in [each.name for each in self.collaborators]
|
|
162
162
|
|
|
163
163
|
|
|
164
|
-
class DummyModel:
|
|
165
|
-
def __init__(self, foo):
|
|
166
|
-
self.foo = foo
|
|
167
|
-
|
|
168
|
-
def __eq__(self, other):
|
|
169
|
-
return self.foo == other.foo
|
|
170
|
-
|
|
171
|
-
def __str__(self):
|
|
172
|
-
return f"bar {self.foo}"
|
|
173
|
-
|
|
174
|
-
|
|
175
164
|
###### Schemas #####
|
|
176
165
|
|
|
177
166
|
|
|
@@ -189,7 +189,7 @@ class FooSerializer(Schema):
|
|
|
189
189
|
|
|
190
190
|
def test_multiple_classes_with_same_name_raises_error():
|
|
191
191
|
# Import a class with the same name
|
|
192
|
-
from .foo_serializer import FooSerializer as FooSerializer1 # noqa: F401
|
|
192
|
+
from .foo_serializer import FooSerializer as FooSerializer1 # noqa: PLC0415, F401
|
|
193
193
|
|
|
194
194
|
class MySchema(Schema):
|
|
195
195
|
foo = fields.Nested("FooSerializer")
|
|
@@ -204,14 +204,14 @@ def test_multiple_classes_with_same_name_raises_error():
|
|
|
204
204
|
|
|
205
205
|
def test_multiple_classes_with_all():
|
|
206
206
|
# Import a class with the same name
|
|
207
|
-
from .foo_serializer import FooSerializer as FooSerializer1 # noqa: F401
|
|
207
|
+
from .foo_serializer import FooSerializer as FooSerializer1 # noqa: PLC0415, F401
|
|
208
208
|
|
|
209
209
|
classes = class_registry.get_class("FooSerializer", all=True)
|
|
210
210
|
assert len(classes) == 2
|
|
211
211
|
|
|
212
212
|
|
|
213
213
|
def test_can_use_full_module_path_to_class():
|
|
214
|
-
from .foo_serializer import FooSerializer as FooSerializer1 # noqa: F401
|
|
214
|
+
from .foo_serializer import FooSerializer as FooSerializer1 # noqa: PLC0415, F401
|
|
215
215
|
|
|
216
216
|
# Using full paths is ok
|
|
217
217
|
|
|
@@ -438,7 +438,7 @@ class TestFieldSerialization:
|
|
|
438
438
|
)
|
|
439
439
|
|
|
440
440
|
def test_structured_dict_value_serialize(self, user):
|
|
441
|
-
user.various_data = {"foo": decimal.Decimal(
|
|
441
|
+
user.various_data = {"foo": decimal.Decimal(1)}
|
|
442
442
|
field = fields.Dict(values=fields.Decimal)
|
|
443
443
|
assert field.serialize("various_data", user) == {"foo": 1}
|
|
444
444
|
|
|
@@ -448,7 +448,7 @@ class TestFieldSerialization:
|
|
|
448
448
|
assert field.serialize("various_data", user) == {"1": "bar"}
|
|
449
449
|
|
|
450
450
|
def test_structured_dict_key_value_serialize(self, user):
|
|
451
|
-
user.various_data = {1: decimal.Decimal(
|
|
451
|
+
user.various_data = {1: decimal.Decimal(1)}
|
|
452
452
|
field = fields.Dict(keys=fields.Str, values=fields.Decimal)
|
|
453
453
|
assert field.serialize("various_data", user) == {"1": 1}
|
|
454
454
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{marshmallow-4.0.0 → marshmallow-4.0.1}/docs/_static/marshmallow-logo-with-title-for-dark-theme.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|