Commit 075118cb authored by Arkadiusz Hiler's avatar Arkadiusz Hiler
Browse files

Update Django Rest Framework to 3.10


Signed-off-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent 5c57f758
python-dateutil>2.0,<3.0
djangorestframework>=3.9,<3.10
djangorestframework>=3.10,<3.11
drf-nested-routers
jsonfield
django-filter>=1.1.0,<1.2.0
......
......@@ -62,7 +62,7 @@ revision_results_router = routers.NestedSimpleRouter(revisions_router,
'revisions',
lookup='version')
revision_results_router.register(r'test-results', api.RevisionResultViewSet,
base_name='revision-results')
basename='revision-results')
# /patches/$id/
patches_router = routers.SimpleRouter()
patches_router.register(r'patches', api.PatchViewSet)
......@@ -70,7 +70,7 @@ patches_router.register(r'patches', api.PatchViewSet)
patch_results_router = routers.NestedSimpleRouter(patches_router, 'patches',
lookup='patch')
patch_results_router.register(r'test-results', api.PatchResultViewSet,
base_name='patch-results')
basename='patch-results')
admin.autodiscover()
......
......@@ -31,7 +31,7 @@ from patchwork.models import (Project, Series, SeriesRevision, Patch, EventLog,
from rest_framework import (views, viewsets, mixins, filters, permissions,
status)
from rest_framework.authentication import BasicAuthentication
from rest_framework.decorators import detail_route
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework.generics import get_object_or_404
from rest_framework.pagination import PageNumberPagination
......@@ -317,22 +317,22 @@ class RevisionViewSet(mixins.ListModelMixin, ListMixin,
context=self.get_serializer_context())
return Response(serializer.data)
@detail_route(methods=['get'])
@action(detail=True, methods=['get'])
def mbox(self, request, series_pk=None, pk=None):
rev = get_object_or_404(SeriesRevision, series=series_pk, version=pk)
return series_mbox(request, rev)
@detail_route(methods=['get'])
@action(detail=True, methods=['get'])
def mbox_with_cover(self, request, series_pk=None, pk=None):
rev = get_object_or_404(SeriesRevision, series=series_pk, version=pk)
return series_mbox(request, rev, with_cover=True)
@detail_route(methods=['get'])
@action(detail=True, methods=['get'])
def cover(self, request, series_pk=None, pk=None):
rev = get_object_or_404(SeriesRevision, series=series_pk, version=pk)
return series_mbox(request, rev, cover_only=True)
@detail_route(methods=['post'])
@action(detail=True, methods=['post'])
def newrevision(self, request, series_pk=None, pk=None):
rev = get_object_or_404(SeriesRevision, series=series_pk, version=pk)
......@@ -566,7 +566,7 @@ class PatchViewSet(mixins.ListModelMixin,
PatchListMixin, ResultMixin,
viewsets.GenericViewSet):
@detail_route(methods=['get'])
@action(detail=True, methods=['get'])
def mbox(self, request, pk=None):
return patch_mbox(request, pk)
......
Markdown is supported
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