Borrowing-TrackerBackend/equipment_tracker/breakages/views.py

15 lines
560 B
Python
Raw Permalink Normal View History

2023-12-09 00:59:17 +08:00
from .serializers import BreakageReportSerializer
from .models import BreakageReport
from rest_framework.permissions import IsAuthenticated
from rest_framework import viewsets
2023-12-09 00:59:17 +08:00
class BreakageReportViewSet(viewsets.ModelViewSet):
# Only allow GET
# Breakage Reports cannot be updated directly
# Changes to the associated Equipment Instances will resolve the Breakage Report itself
http_method_names = ['get']
permission_classes = [IsAuthenticated]
serializer_class = BreakageReportSerializer
queryset = BreakageReport.objects.all()