Fix an error
This commit is contained in:
parent
2cc8af0fef
commit
a6aff36585
@ -254,12 +254,9 @@ class RelationshipLoader:
|
|||||||
[*exclude_classes, cls] # excluding the current class because we don't want bidirectional relationships to create infinite loop
|
[*exclude_classes, cls] # excluding the current class because we don't want bidirectional relationships to create infinite loop
|
||||||
)
|
)
|
||||||
for nested_rel, nested_strategy in nested_relationships.items():
|
for nested_rel, nested_strategy in nested_relationships.items():
|
||||||
# if it is a nested relationship, I am assuming it should be loaded with selectinload.
|
((strategy_name, attr),) = load_strategy.items()
|
||||||
# i don't know a better way to handle this but this is working fine for us.
|
((_, nested_attr),) = nested_strategy.items()
|
||||||
combined = load_strategy["selectinload"].copy()
|
relationships[f"{rel.key}.{nested_rel}"] = {strategy_name: [*attr, *nested_attr]}
|
||||||
combined.extend(nested_strategy["selectinload"])
|
|
||||||
combined = {"selectinload": combined}
|
|
||||||
relationships[f"{rel.key}.{nested_rel}"] = combined
|
|
||||||
|
|
||||||
return relationships
|
return relationships
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user