Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

New API endpoint to fetch dataset directory #81

Merged
merged 7 commits into from Sep 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -35,6 +35,7 @@ htmlcov/

# workspace files are user-specific
*.sublime-workspace
.vscode

# npm
node_modules/
Expand All @@ -61,4 +62,4 @@ prediction/data/*
*.db

# ignore data
data/
data/
2 changes: 2 additions & 0 deletions interface/backend/api/urls.py
Expand Up @@ -3,6 +3,7 @@
CandidateViewSet,
NoduleViewSet,
ImageSeriesViewSet,
ImageAvailableApiView,
candidate_mark,
candidate_dismiss,
)
Expand All @@ -21,6 +22,7 @@
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^images/available$', ImageAvailableApiView.as_view(), name='image-available'),
url(r'^candidates/(?P<candidate_id>\d+)/dismiss$', candidate_dismiss, name='candidate-dismiss'),
url(r'^candidates/(?P<candidate_id>\d+)/mark$', candidate_mark, name='candidate-mark'),
]
14 changes: 14 additions & 0 deletions interface/backend/api/views.py
Expand Up @@ -4,6 +4,8 @@
Candidate,
Nodule,
)
from rest_framework.views import APIView
from rest_framework.response import Response
from backend.images.models import ImageSeries
from django.http import JsonResponse
from rest_framework import viewsets
Expand All @@ -29,6 +31,18 @@ class ImageSeriesViewSet(viewsets.ModelViewSet):
serializer_class = serializers.ImageSeriesSerializer


class ImageAvailableApiView(APIView):
"""
View list of images from dataset directory
"""
def get(self, request):
"""
Return a list of files and folders in dataset
TODO implement directory retrieval method
"""
return Response([])


def candidate_mark(request, candidate_id):
return JsonResponse({'response': "Candidate {} was marked".format(candidate_id)})

Expand Down