From 32a33c332df3b356e16bd81a11b284b5627875e4 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Tue, 22 Mar 2022 12:33:52 +0100 Subject: [PATCH] Don't serialize annotated types (#881) Signed-off-by: Sebastian Wagner Co-authored-by: Sebastian Wagner --- mypy_django_plugin/transformers/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mypy_django_plugin/transformers/models.py b/mypy_django_plugin/transformers/models.py index 730a4d3db..06b252ddc 100644 --- a/mypy_django_plugin/transformers/models.py +++ b/mypy_django_plugin/transformers/models.py @@ -533,6 +533,7 @@ def get_or_create_annotated_type( type_name, bases=[model_type] if fields_dict is not None else [model_type, annotated_model_type], fields=fields_dict.items if fields_dict is not None else None, + no_serialize=True, ) if fields_dict is not None: # To allow structural subtyping, make it a Protocol