fix imports and styles after refactor

This commit is contained in:
collerek
2020-09-15 12:53:14 +02:00
parent ca21e5dde5
commit 6124830642
7 changed files with 12 additions and 9 deletions
BIN
View File
Binary file not shown.
+1
View File
@@ -39,4 +39,5 @@ __all__ = [
"NoMatch",
"ForeignKey",
"QuerySet",
"RelationType",
]
+1 -1
View File
@@ -1,5 +1,5 @@
from ormar.relations.relation import Relation, RelationType
from ormar.relations.alias_manager import AliasManager
from ormar.relations.relation import Relation, RelationType
from ormar.relations.relation_manager import RelationsManager
__all__ = ["AliasManager", "Relation", "RelationsManager", "RelationType"]
+2 -1
View File
@@ -1,10 +1,11 @@
from typing import TYPE_CHECKING, Union, List, Any, Tuple
from typing import Any, List, TYPE_CHECKING, Tuple, Union
import ormar
if TYPE_CHECKING: # pragma no cover
from ormar.relations import Relation
from ormar.models import Model
from ormar.queryset import QuerySet
class QuerysetProxy:
-2
View File
@@ -77,5 +77,3 @@ class Relation:
def __repr__(self) -> str: # pragma no cover
return str(self.related_models)
+5 -2
View File
@@ -1,5 +1,5 @@
from _weakref import proxy
from typing import List, Type, Optional, Union, Tuple
from typing import List, Optional, TYPE_CHECKING, Tuple, Type, Union
from weakref import proxy
import ormar
from ormar.exceptions import RelationshipInstanceError
@@ -8,6 +8,9 @@ from ormar.fields.many_to_many import ManyToManyField
from ormar.relations import Relation
from ormar.relations.relation import RelationType
if TYPE_CHECKING: # pragma no cover
from ormar import Model
class RelationsManager:
def __init__(
+2 -2
View File
@@ -40,8 +40,8 @@ class RelationProxy(list):
kwargs = {f"{owner_table}__{pkname}": pk_value}
queryset = (
ormar.QuerySet(model_cls=self.relation.to)
.select_related(owner_table)
.filter(**kwargs)
.select_related(owner_table)
.filter(**kwargs)
)
return queryset