2016-10-18 20:23:10 +00:00
|
|
|
from rest_framework import serializers, viewsets
|
|
|
|
from rest_framework.response import Response
|
|
|
|
from rest_framework.decorators import permission_classes
|
|
|
|
from rest_framework.permissions import DjangoModelPermissions
|
|
|
|
from rest_framework.filters import DjangoFilterBackend
|
|
|
|
from nodeodm.models import ProcessingNode
|
|
|
|
|
|
|
|
class ProcessingNodeSerializer(serializers.ModelSerializer):
|
|
|
|
class Meta:
|
|
|
|
model = ProcessingNode
|
2016-10-22 17:11:11 +00:00
|
|
|
fields = '__all__'
|
2016-10-18 20:23:10 +00:00
|
|
|
|
|
|
|
class ProcessingNodeViewSet(viewsets.ModelViewSet):
|
|
|
|
"""
|
|
|
|
Processing nodes available. Processing nodes are associated with
|
|
|
|
zero or more tasks and take care of processing input images.
|
|
|
|
"""
|
|
|
|
|
|
|
|
# Don't need a "view node" permission. If you are logged-in, you can view nodes.
|
|
|
|
permission_classes = (DjangoModelPermissions, )
|
|
|
|
filter_backends = (DjangoFilterBackend, )
|
|
|
|
pagination_class = None
|
|
|
|
serializer_class = ProcessingNodeSerializer
|
|
|
|
queryset = ProcessingNode.objects.all()
|