remove .vscode settings, re-dump orjson choices to fix choices, move mypy config into pyproject.toml

This commit is contained in:
collerek
2021-10-08 20:14:03 +02:00
parent b2541bed1e
commit b637fc0774
14 changed files with 69 additions and 45 deletions

View File

@ -1,5 +1,15 @@
import uuid
from typing import Callable, Collection, Dict, List, Optional, Set, TYPE_CHECKING, cast
from typing import (
Any,
Callable,
Collection,
Dict,
List,
Optional,
Set,
TYPE_CHECKING,
cast,
)
import ormar
from ormar.exceptions import ModelPersistenceError
@ -93,7 +103,7 @@ class SavePrepareMixin(RelationMixin, AliasMixin):
if field.__type__ == uuid.UUID and name in model_dict:
parsers = {"string": lambda x: str(x), "hex": lambda x: "%.32x" % x.int}
uuid_format = field.column_type.uuid_format
parser = parsers.get(uuid_format, lambda x: x)
parser: Callable[..., Any] = parsers.get(uuid_format, lambda x: x)
model_dict[name] = parser(model_dict[name])
return model_dict