Skip to content

Commit 28c25c5

Browse files
authored
add base_study attribute (#599)
1 parent 16908b1 commit 28c25c5

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

store/neurostore/openapi

store/neurostore/resources/data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ def view_search(self, q, args):
339339

340340
def join_tables(self, q):
341341
"join relevant tables to speed up query"
342+
q = q.options(joinedload("base_study"))
342343
q = q.options(joinedload("analyses"))
343344
return super().join_tables(q)
344345

store/neurostore/schemas/data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ class StudySchema(BaseDataSchema):
330330
dump_only=True, metadata={"db_only": True}, allow_none=True
331331
)
332332
studysets = fields.Pluck("StudysetSchema", "_id", many=True, dump_only=True)
333+
base_study = fields.Pluck("BaseStudySchema", "_id", dump_only=True, metadata={"db_only": True})
333334
has_coordinates = fields.Bool(dump_only=True)
334335
has_images = fields.Bool(dump_only=True)
335336
# studysets = fields.Nested(

0 commit comments

Comments
 (0)