Skip to content

Commit

Permalink
Merge pull request #346 from ResearchIT/jbrowse-api-performance
Browse files Browse the repository at this point in the history
Speed up JBrowse RefSeqs endpoint
  • Loading branch information
azneto authored Aug 1, 2022
2 parents 22b0b1d + 45a1b14 commit f3deb57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion machado/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def get_display(self, obj):
return obj.get_display()


class JBrowseRefseqSerializer(serializers.ModelSerializer):
class JBrowseRefseqSerializer(serializers.Serializer):
"""JBrowse transcript serializer."""

start = serializers.SerializerMethodField()
Expand Down
2 changes: 2 additions & 0 deletions machado/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ def get_queryset(self):
if sotype is not None:
queryset = queryset.filter(type__cv__name="sequence", type__name=sotype)

queryset = queryset.only("seqlen", "uniquename")

return queryset

@method_decorator(cache_page(CACHE_TIMEOUT))
Expand Down

0 comments on commit f3deb57

Please sign in to comment.