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-08 23:00:15 +08:00
|
|
|
|
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()
|