Skip to content

Commit

Permalink
fix(wip)?: joinload types on "taxref" routestaxref
Browse files Browse the repository at this point in the history
Reviewed-by: andriacap
  • Loading branch information
andriacap committed Nov 20, 2024
1 parent 18b662f commit dc6a1e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apptax/taxonomie/routestaxref.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
BibListes,
TMetaTaxref,
CorTaxonAttribut,
TMedias,
)

from .repositories import BdcStatusRepository
Expand Down Expand Up @@ -212,6 +213,7 @@ def getTaxrefDetail(id):
"attributs",
"listes",
"medias",
"medias.types",
"status",
"synonymes.cd_nom",
"synonymes.nom_complet",
Expand All @@ -226,6 +228,9 @@ def getTaxrefDetail(id):
fields = [f for f in fields if not f.split(".")[0] == "status"]

joinedload_when_attributs = get_joinedload_when_attributs(fields=fields)
if "medias" in firstlevel_fields:
joinedload_when_attributs.append(joinedload(Taxref.medias).joinedload(TMedias.types))

query = (
Taxref.joined_load(join_relationship)
.options(*joinedload_when_attributs)
Expand Down

0 comments on commit dc6a1e8

Please sign in to comment.