mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +00:00
django2.2: unlock djangorestframework version limit
This commit is contained in:
parent
cd2d3ee6b4
commit
c3f2d0a134
@ -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/)
|
||||
|
@ -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/)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -5,7 +5,7 @@ mistune
|
||||
django-jinja
|
||||
pyopenssl
|
||||
pytz
|
||||
djangorestframework <3.10
|
||||
djangorestframework
|
||||
django-phonenumber-field
|
||||
phonenumbers
|
||||
django-ajax-selects
|
||||
|
Loading…
Reference in New Issue
Block a user