Skip to content

Commit

Permalink
preload more attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkent committed Nov 7, 2023
1 parent 007a84c commit 94a8e8a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions store/neurostore/resources/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sqlalchemy.sql.expression as sae
from sqlalchemy.orm import joinedload
from sqlalchemy.sql import func
from sqlalchemy import union


from .utils import view_maker
Expand Down Expand Up @@ -227,8 +228,11 @@ def post(self):
BaseStudy.query.filter_by(**filter_params)
.options(
joinedload(BaseStudy.versions)
.joinedload(Study.studyset_studies)
.joinedload(StudysetStudy.studyset)
.options(joinedload(Study.studyset_studies)
.joinedload(StudysetStudy.studyset),
joinedload(Study.user),
),
joinedload(BaseStudy.user)
)
.one_or_none()
)
Expand Down

0 comments on commit 94a8e8a

Please sign in to comment.