django2.2: unlock djangorestframework version limit

This commit is contained in:
Antoine Bartuccio 2019-10-06 17:59:38 +02:00
parent cd2d3ee6b4
commit c3f2d0a134
Signed by: klmp200
GPG Key ID: E7245548C53F904B
5 changed files with 12 additions and 12 deletions

View File

@ -25,7 +25,7 @@
from rest_framework.response import Response
from rest_framework import viewsets
from django.core.exceptions import PermissionDenied
from rest_framework.decorators import detail_route
from rest_framework.decorators import action
from django.db.models.query import QuerySet
from core.views import can_view, can_edit
@ -46,7 +46,7 @@ def check_if(obj, user, test):
class ManageModelMixin:
@detail_route()
@action(detail=True)
def id(self, request, pk=None):
"""
Get by id (api/v1/router/{pk}/id/)

View File

@ -24,7 +24,7 @@
from rest_framework import serializers
from rest_framework.response import Response
from rest_framework.decorators import list_route
from rest_framework.decorators import action
from counter.models import Counter
@ -51,7 +51,7 @@ class CounterViewSet(RightModelViewSet):
serializer_class = CounterSerializer
queryset = Counter.objects.all()
@list_route()
@action(detail=False)
def bar(self, request):
"""
Return all bars (api/v1/counter/bar/)

View File

@ -24,7 +24,7 @@
from rest_framework import serializers
from rest_framework.response import Response
from rest_framework.decorators import list_route
from rest_framework.decorators import action
from launderette.models import Launderette, Machine, Token
@ -96,7 +96,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer_class = LaunderetteTokenSerializer
queryset = Token.objects.all()
@list_route()
@action(detail=False)
def washing(self, request):
"""
Return all washing tokens (api/v1/launderette/token/washing)
@ -105,7 +105,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer = self.get_serializer(self.queryset, many=True)
return Response(serializer.data)
@list_route()
@action(detail=False)
def drying(self, request):
"""
Return all drying tokens (api/v1/launderette/token/drying)
@ -114,7 +114,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer = self.get_serializer(self.queryset, many=True)
return Response(serializer.data)
@list_route()
@action(detail=False)
def avaliable(self, request):
"""
Return all avaliable tokens (api/v1/launderette/token/avaliable)
@ -125,7 +125,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer = self.get_serializer(self.queryset, many=True)
return Response(serializer.data)
@list_route()
@action(detail=False)
def unavaliable(self, request):
"""
Return all unavaliable tokens (api/v1/launderette/token/unavaliable)

View File

@ -26,7 +26,7 @@ import datetime
from rest_framework import serializers
from rest_framework.response import Response
from rest_framework.decorators import list_route
from rest_framework.decorators import action
from core.models import User
@ -57,7 +57,7 @@ class UserViewSet(RightModelViewSet):
serializer_class = UserSerializer
queryset = User.objects.filter(is_active=True)
@list_route()
@action(detail=False)
def birthday(self, request):
"""
Return all users born today (api/v1/user/birstdays)

View File

@ -5,7 +5,7 @@ mistune
django-jinja
pyopenssl
pytz
djangorestframework <3.10
djangorestframework
django-phonenumber-field
phonenumbers
django-ajax-selects