wip - some cleanup
This commit is contained in:
@ -23,11 +23,10 @@ from ormar import MultipleMatches, NoMatch
|
||||
from ormar.exceptions import ModelPersistenceError, QueryDefinitionError
|
||||
from ormar.queryset import FilterQuery, SelectAction
|
||||
from ormar.queryset.actions.order_action import OrderAction
|
||||
from ormar.queryset.clause import FilterGroup, Prefix, QueryClause
|
||||
from ormar.queryset.clause import FilterGroup, QueryClause
|
||||
from ormar.queryset.prefetch_query import PrefetchQuery
|
||||
from ormar.queryset.query import Query
|
||||
from ormar.queryset.reverse_alias_resolver import ReverseAliasResolver
|
||||
from ormar.queryset.utils import get_relationship_alias_model_and_str
|
||||
|
||||
if TYPE_CHECKING: # pragma no cover
|
||||
from ormar import Model
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
from typing import Dict, List, TYPE_CHECKING, Tuple, Type
|
||||
|
||||
from ormar.queryset.clause import Prefix
|
||||
from ormar.queryset.utils import get_relationship_alias_model_and_str
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ormar import Model
|
||||
from ormar.models.excludable import ExcludableItems
|
||||
|
||||
@ -43,7 +43,13 @@ class AliasManager:
|
||||
return self._aliases_new.__getitem__(key)
|
||||
|
||||
@property
|
||||
def reversed_aliases(self):
|
||||
def reversed_aliases(self) -> Dict:
|
||||
"""
|
||||
Returns swapped key-value pairs from aliases where alias is the key.
|
||||
|
||||
:return: dictionary of prefix to relation
|
||||
:rtype: Dict
|
||||
"""
|
||||
if self._reversed_aliases:
|
||||
return self._reversed_aliases
|
||||
reversed_aliases = {v: k for k, v in self._aliases_new.items()}
|
||||
|
||||
Reference in New Issue
Block a user