Refactor in join in order to make possibility for nested duplicated relations (and it was a mess :D)
This commit is contained in:
@ -113,6 +113,19 @@ class AliasManager:
|
||||
if child_key not in self._aliases_new:
|
||||
self._aliases_new[child_key] = get_table_alias()
|
||||
|
||||
def add_alias(self, alias_key: str) -> str:
|
||||
"""
|
||||
Adds alias to the dictionary of aliases under given key.
|
||||
|
||||
:param alias_key: key of relation to generate alias for
|
||||
:type alias_key: str
|
||||
:return: generated alias
|
||||
:rtype: str
|
||||
"""
|
||||
alias = get_table_alias()
|
||||
self._aliases_new[alias_key] = alias
|
||||
return alias
|
||||
|
||||
def resolve_relation_alias(
|
||||
self, from_model: Type["Model"], relation_name: str
|
||||
) -> str:
|
||||
|
||||
@ -127,7 +127,7 @@ class RelationProxy(list):
|
||||
self, item: "Model", keep_reversed: bool = True
|
||||
) -> None:
|
||||
"""
|
||||
Removes the item from relation with parent.
|
||||
Removes the related from relation with parent.
|
||||
|
||||
Through models are automatically deleted for m2m relations.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user