fix using deprecated SQLAlchemy mapping access

This commit is contained in:
ducklet 2023-03-18 00:29:29 +01:00
parent eb76ab1867
commit 496c51402a
3 changed files with 11 additions and 9 deletions

View file

@ -10,6 +10,7 @@ from typing import (
ClassVar,
Container,
Literal,
Mapping,
Type,
TypeVar,
Union,
@ -144,7 +145,7 @@ def asplain(
return d
def fromplain(cls: Type[T], d: dict[str, Any], *, serialized: bool = False) -> T:
def fromplain(cls: Type[T], d: Mapping, *, serialized: bool = False) -> T:
"""Return an instance of the given model using the given data.
If `serialized` is `True`, collection types (lists, dicts, etc.) will be