Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
266e125e
Commit
266e125e
authored
Nov 04, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
use prefetch and select to improve performances
parent
ead2f182
Pipeline
#17578
passed with stages
in 2 minutes and 35 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
backend/metagenedb/api/catalog/views/gene.py
View file @
266e125e
...
...
@@ -43,7 +43,7 @@ class DocGeneLength(object):
class
GeneViewSet
(
BulkViewSet
):
queryset
=
Gene
.
objects
.
all
()
queryset
=
Gene
.
objects
.
select_related
(
'taxonomy'
).
prefetch_related
(
'functions'
).
all
()
serializer_class
=
GeneSerializer
lookup_field
=
'gene_id'
GENE_LENGTH_COL
=
'length'
...
...
backend/metagenedb/api/catalog/views/taxonomy.py
View file @
266e125e
...
...
@@ -8,7 +8,8 @@ from .bulk_viewset import BulkViewSet
class
TaxonomyViewSet
(
BulkViewSet
):
queryset
=
Taxonomy
.
objects
.
all
()
queryset
=
Taxonomy
.
objects
.
select_related
(
"parent"
,
"superkingdom"
,
"kingdom"
,
"phylum"
,
"class_rank"
,
"order"
,
"family"
,
"genus"
,
"species"
).
all
()
serializer_class
=
TaxonomySerializer
lookup_field
=
'tax_id'
filterset_class
=
TaxonomyFilter
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment