Skip to content

Commit

Permalink
Add filtration to alignments by alignment_run_id endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanjay Boddu committed Sep 30, 2020
1 parent c169ecd commit 3243c61
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion restui/views/alignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,13 @@ def get_queryset(self):
except (AlignmentRun.DoesNotExist, IndexError):
raise Http404

return Alignment.objects.filter(alignment_run=alignment_run).order_by('alignment_id')
mapping_ids = self.request.query_params.get('mapping_id', None)

if mapping_ids is not None:
mapping_ids = mapping_ids.split(',')
return Alignment.objects.filter(alignment_run=alignment_run, mapping_id__in=mapping_ids)
else:
return Alignment.objects.filter(alignment_run=alignment_run).order_by('alignment_id')


#
Expand Down

0 comments on commit 3243c61

Please sign in to comment.