This PR adds support to get selected results for a job id, instead of all of them.
For a job id, say a6fd2841-199c-49b1-9be1-039c0648339d:
/py/job/query/a6fd2841-199c-49b1-9be1-039c0648339d takes you to the result page. This page currently makes no ajax calls, but it should.
/py/job/query/result/json/a6fd2841-199c-49b1-9be1-039c0648339d gives you the json results for the job. This is the most natural ajax endpoint to use for the page above.
This PR will allow you to visit the above link with additional arguments like (all arguments optional):
to get results of the CDC28 region with optional ordering and filtering.
DataTables requires that you return json data in exactly the format it wants with exactly the keys it wants. To make this work with DataTables, you'll likely want to merge this PR into your branch (merging to main first is also okay since it only adds to the behavior), write a helper function that utilizes the return value of the result function modified here, and then adds whatever keys etc. DataTables wants. That way we can keep this filtering generic enough, and document it independently of how we're using it for DataTables.
A more ambitious idea is to make all results we return anywhere support this kind of filtering and pagination, but I think that's best deferred till we investigate FastAPI in the future which may well have much better ways of doing this.
This PR adds support to get selected results for a job id, instead of all of them.
For a job id, say
a6fd2841-199c-49b1-9be1-039c0648339d
:/py/job/query/a6fd2841-199c-49b1-9be1-039c0648339d
takes you to the result page. This page currently makes no ajax calls, but it should./py/job/query/result/json/a6fd2841-199c-49b1-9be1-039c0648339d
gives you thejson
results for the job. This is the most natural ajax endpoint to use for the page above.This PR will allow you to visit the above link with additional arguments like (all arguments optional):
/py/job/query/result/json/a6fd2841-199c-49b1-9be1-039c0648339d?region=CDC28&orderby=specificity&asc=1&start=3&limit=2
to get results of the
CDC28
region with optional ordering and filtering.DataTables requires that you return
json
data in exactly the format it wants with exactly the keys it wants. To make this work with DataTables, you'll likely want to merge this PR into your branch (merging tomain
first is also okay since it only adds to the behavior), write a helper function that utilizes the return value of theresult
function modified here, and then adds whatever keys etc. DataTables wants. That way we can keep this filtering generic enough, and document it independently of how we're using it for DataTables.A more ambitious idea is to make all results we return anywhere support this kind of filtering and pagination, but I think that's best deferred till we investigate FastAPI in the future which may well have much better ways of doing this.