|
80 | 80 |
|
81 | 81 |
|
82 | 82 | class Field(FieldABC):
|
83 |
| - """Basic field from which other fields should extend. It applies no |
84 |
| - formatting by default, and should only be used in cases where |
85 |
| - data does not need to be formatted before being serialized or deserialized. |
| 83 | + """Base field from which other fields inherit. |
86 | 84 |
|
87 | 85 | :param dump_default: If set, this value will be used during serialization if the
|
88 | 86 | input value is missing. If not set, the field will be excluded from the
|
@@ -123,6 +121,10 @@ class Field(FieldABC):
|
123 | 121 |
|
124 | 122 | .. versionchanged:: 3.13.0
|
125 | 123 | Replace ``missing`` and ``default`` parameters with ``load_default`` and ``dump_default``.
|
| 124 | +
|
| 125 | + .. versionchanged:: 3.24.0 |
| 126 | + `Field <marshmallow.fields.Field>` should no longer be used as a field within a `Schema <marshmallow.Schema>`. |
| 127 | + Use `Raw <marshmallow.fields.Raw>` or another `Field <marshmallow.fields.Field>` subclass instead. |
126 | 128 | """
|
127 | 129 |
|
128 | 130 | # Some fields, such as Method fields and Function fields, are not expected
|
@@ -950,6 +952,10 @@ class Number(Field, typing.Generic[_NumType]):
|
950 | 952 |
|
951 | 953 | :param as_string: If `True`, format the serialized value as a string.
|
952 | 954 | :param kwargs: The same keyword arguments that :class:`Field` receives.
|
| 955 | +
|
| 956 | + .. versionchanged:: 3.24.0 |
| 957 | + `Number <marshmallow.fields.Number>` should no longer be used as a field within a `Schema <marshmallow.Schema>`. |
| 958 | + Use `Integer <marshmallow.fields.Integer>`, `Float <marshmallow.fields.Float>`, or `Decimal <marshmallow.fields.Decimal>` instead. |
953 | 959 | """
|
954 | 960 |
|
955 | 961 | num_type: type = float
|
@@ -1566,6 +1572,9 @@ class Mapping(Field):
|
1566 | 1572 | `keys` and `values` arguments to prevent content validation.
|
1567 | 1573 |
|
1568 | 1574 | .. versionadded:: 3.0.0rc4
|
| 1575 | + .. versionchanged:: 3.24.0 |
| 1576 | + `Mapping <marshmallow.fields.Mapping>` should no longer be used as a field within a `Schema <marshmallow.Schema>`. |
| 1577 | + Use `Dict <marshmallow.fields.Dict>` instead. |
1569 | 1578 | """
|
1570 | 1579 |
|
1571 | 1580 | mapping_type = dict
|
|
0 commit comments