Skip to content

Commit

Permalink
change how coordinates/images are found
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkent committed Aug 23, 2023
1 parent f8f677c commit 5e454a4
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions store/neurostore/resources/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,15 @@ def view_search(self, q, args):
# search studies for data_type
if args.get("data_type"):
if args["data_type"] == "coordinate":
q = q.filter(
self._model.versions.any(Study.analyses.any(Analysis.points.any()))
)
q = q.filter_by(has_coordinates=True)
elif args["data_type"] == "image":
q = q.filter(
self._model.versions.any(Study.analyses.any(Analysis.images.any()))
)
q = q.filter_by(has_images=True)
elif args["data_type"] == "both":
q = q.filter(
sae.or_(
self._model.versions.any(
Study.analyses.any(Analysis.points.any())
),
self._model.versions.any(
Study.analyses.any(Analysis.images.any())
),
)
self._model.has_coordinates.is_(True),
self._model.has_images.is_(True),
),
)
# filter by level of analysis (group or meta)
if args.get("level"):
Expand Down

0 comments on commit 5e454a4

Please sign in to comment.