refactor and cleanup

This commit is contained in:
collerek
2020-08-23 17:50:40 +02:00
parent f73a97e560
commit 0f72bf36eb
13 changed files with 248 additions and 216 deletions

View File

@ -1,4 +1,4 @@
from typing import Any, List, Optional, TYPE_CHECKING
from typing import Any, List, Optional, TYPE_CHECKING, Union
import sqlalchemy
from pydantic import Field
@ -7,6 +7,7 @@ from ormar import ModelDefinitionError # noqa I101
if TYPE_CHECKING: # pragma no cover
from ormar.models import Model
from ormar.models import FakePydantic
class BaseField:
@ -62,5 +63,7 @@ class BaseField:
)
@classmethod
def expand_relationship(cls, value: Any, child: "Model") -> Any:
def expand_relationship(
cls, value: Any, child: Union["Model", "FakePydantic"]
) -> Any:
return value