Fix an error

This commit is contained in:
Şahin Akkaya 2024-08-05 16:35:26 +03:00
parent a6aff36585
commit f1edcb8e54

View File

@ -243,7 +243,7 @@ class RelationshipLoader:
load_strategy = ( # if it is a one to one or many to one relationship we are loading it with selectinload strategy, else joinedload
{"selectinload": [getattr(cls, rel.key)]}
if rel.direction.name in ["MANYTOONE", "ONETOMANY"]
else {"joinedload": getattr(cls, rel.key)}
else {"joinedload": [getattr(cls, rel.key)]}
)
relationships[rel.key] = load_strategy