From 59203db95bf811d4b964cb778ba3619174b95e78 Mon Sep 17 00:00:00 2001 From: Savva Surenkov Date: Tue, 26 Mar 2024 02:08:47 +0400 Subject: [PATCH] Update `compat.django` module docstring --- django_pydantic_field/compat/django.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/django_pydantic_field/compat/django.py b/django_pydantic_field/compat/django.py index 3c8a8dd..b33e391 100644 --- a/django_pydantic_field/compat/django.py +++ b/django_pydantic_field/compat/django.py @@ -13,6 +13,14 @@ `typing.Union` and its special forms, like `typing.Optional`, have its own inheritance chain. Moreover, `types.UnionType`, introduced in 3.10, do not allow explicit type construction, only with `X | Y` syntax. Both cases require a dedicated serializer for migration writes. + +[typing.Annotated](https://peps.python.org/pep-0593/) + `typing.Annotated` syntax is supported for direct field annotations, though I find it highly discouraged + while using in `schema=` attribute. + The limitation with `Annotated` types is that supplied metadata could be actually of any type. + In case of Pydantic, it is a `FieldInfo` objects, which are not compatible with Django Migrations serializers. + This module provides a few containers (`FieldInfoContainer` and `DataclassContainer`), + which allow Model serializers to work. """ from __future__ import annotations