Djangorestframework-dataclasses

Latest version: v1.3.1

Safety actively analyzes 687918 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

1.3.1

------------------------
Features & fixes:

* Fix inclusion of py.typed in wheel.

1.3.0

---------------------
Breaking changes:

* The type annotations now require mypy 1.0 or higher to validate correctly.

Features & fixes:

* Create values for fields of non-``list`` or ``dict`` composite types (such as ``frozenset`` or ``OrderedDict``) as
that type, instead of ``list`` or ``dict``.
* Allow overriding the field for specific composite types through the ``serializer_field_mapping`` dictionary.
* Don't set optional fields to ``rest_framework.fields.empty`` sentinel value when used in non-partial mode. This fixes
occasional leaks of the sentinel into dataclasses returned to the user, for example when a ``DataclassSerializer`` was
nested inside a regular serializer. Not setting, and later stripping, the sentinels also increases performance.
* Support dataclasses with fields that have ``init=False``.
* Support ``save()`` on serializers with ``many=True``.
* Support for fields with union types.
* Support nested serializers with ``source='*'``.
* Fix ``child_kwargs`` defined in dataclass field metadata (as opposed to ``extra_kwargs`` field on ``Meta`` subclass).

1.2.0

-----------------------
Features & fixes:

* Allow all types, including special forms such as unions, to have their field type overridden through the
``serializer_field_mapping`` dictionary.
* Also treat unions containing ``None`` as optional if they consist of three or more members. Previously this was only
the case for unions with two members (i.e. only unions of a type with ``None`` were optional).
* Many added and fixed type hints.

1.1.1

----------------------
Features & fixes:

* Fix usage of PEP 585 generics with forward references (e.g. ``list["str"]``).
* Fix usage of ``allow_empty`` with ``many=True``.

1.1.0

---------------------
Features & fixes:

* Allow using the new ``X | None`` union syntax for specifying optional fields in Python 3.10+ (PEP 604).

1.0.0

----------------------
Features & fixes:

* Allow serialization of properties created using property decorator.
* Allow dataclass types to be serialized by a type not inheriting from ``DataclassSerializer`` (usually a ``Field``).

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.