Commit 98af56fe authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

Also allow upsert with PUT for taxonomy

parent 000835ac
......@@ -4,8 +4,10 @@ from metagenedb.api.catalog.filters import TaxonomyFilter
from metagenedb.apps.catalog.models import Taxonomy
from metagenedb.apps.catalog.serializers import TaxonomySerializer
from .bulk_viewset import BulkViewSet
class TaxonomyViewSet(ModelViewSet):
class TaxonomyViewSet(BulkViewSet):
queryset = Taxonomy.objects.all()
serializer_class = TaxonomySerializer
lookup_field = 'tax_id'
......
from rest_framework import serializers
from metagenedb.apps.catalog.models import Taxonomy
from .bulk_list import BulkListSerializer
class TaxonomyListSerializer(BulkListSerializer):
class Meta:
model = Taxonomy
class TaxonomySerializer(serializers.ModelSerializer):
rank = serializers.CharField(required=False)
......@@ -53,6 +61,7 @@ class TaxonomySerializer(serializers.ModelSerializer):
class Meta:
model = Taxonomy
list_serializer_class = TaxonomyListSerializer
fields = (
'tax_id', 'name', 'rank', 'parent_tax_id', 'superkingdom',
'kingdom', 'phylum', 'class_rank', 'order', 'family', 'genus', 'species',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment