1234567891011121314151617181920212223242526272829303132333435363738 |
- from rest_framework import generics, permissions
- from rest_framework_api_key.permissions import HasAPIKey
- from tickets.api.v2.serializers.tickets import TicketSerializer
- from tickets.models import Ticket
- class TicketPatchAPIView(generics.UpdateAPIView):
- """
- API для частичного обновления тикета
- """
- queryset = Ticket.objects.all()
- serializer_class = TicketSerializer
- permission_classes = [
- permissions.IsAuthenticated | HasAPIKey
- ]
- class TicketListAPIView(generics.ListAPIView):
- """
- API для получения списка тикетов
- """
- queryset = Ticket.objects.all()
- serializer_class = TicketSerializer
- permission_classes = [
- permissions.IsAuthenticated | HasAPIKey
- ]
- filterset_fields = (
- 'title',
- 'ticket_list',
- 'ticket_type',
- 'status',
- 'created_by',
- 'assigned_to',
- )
|