14 lines
436 B
Python
14 lines
436 B
Python
from rest_framework import viewsets
|
|
|
|
from .models import Species, CollectionSpecies
|
|
from .serializers import SpeciesSerializer, CollectionSpeciesSerializer
|
|
|
|
|
|
class SpeciesViewSet(viewsets.ModelViewSet):
|
|
queryset = Species.objects.all()
|
|
serializer_class = SpeciesSerializer
|
|
|
|
|
|
class CollectionSpeciesViewSet(viewsets.ModelViewSet):
|
|
queryset = CollectionSpecies.objects.all()
|
|
serializer_class = CollectionSpeciesSerializer
|