some further cleanup and optim

This commit is contained in:
collerek
2020-11-12 08:56:16 +01:00
parent e743286008
commit d8391851fa
7 changed files with 56 additions and 48 deletions

View File

@ -1,9 +1,7 @@
from ormar.relations.alias_manager import AliasManager
from ormar.relations.relation import Relation, RelationType
from ormar.relations.relation_manager import RelationsManager
from ormar.relations.utils import (
get_relations_sides_and_names,
)
from ormar.relations.utils import get_relations_sides_and_names
__all__ = [
"AliasManager",

View File

@ -5,9 +5,7 @@ from ormar.fields import BaseField
from ormar.fields.foreign_key import ForeignKeyField
from ormar.fields.many_to_many import ManyToManyField
from ormar.relations.relation import Relation, RelationType
from ormar.relations.utils import (
get_relations_sides_and_names,
)
from ormar.relations.utils import get_relations_sides_and_names
if TYPE_CHECKING: # pragma no cover
from ormar import Model

View File

@ -9,11 +9,11 @@ if TYPE_CHECKING: # pragma no cover
def get_relations_sides_and_names(
to_field: Type[BaseField],
parent: "Model",
child: "Model",
child_name: str,
virtual: bool,
to_field: Type[BaseField],
parent: "Model",
child: "Model",
child_name: str,
virtual: bool,
) -> Tuple["Model", "Model", str, str]:
to_name = to_field.name
if issubclass(to_field, ManyToManyField):