|
@@ -1,18 +1,13 @@
|
|
-from django.http import Http404, HttpResponse
|
|
|
|
from django.shortcuts import get_object_or_404
|
|
from django.shortcuts import get_object_or_404
|
|
-from webservice_running.serializer import OrdersLocalSerializer
|
|
|
|
-from rest_framework import viewsets, permissions, status
|
|
|
|
|
|
+from rest_framework import viewsets, permissions
|
|
from rest_framework.response import Response
|
|
from rest_framework.response import Response
|
|
-from rest_framework.exceptions import NotFound
|
|
|
|
-from webservice_running.models import OrdersLocal
|
|
|
|
-# from metaservicesynced.models import Orders, Service, ServiceType, Provider, Client
|
|
|
|
-# from SharixAdmin.models import SharixUser
|
|
|
|
-# from tickets.models import Task
|
|
|
|
-# from tickets.serializer import TaskSerializer
|
|
|
|
|
|
+from webservice_running.models import Event
|
|
|
|
+from webservice_running.serializers import EventSerializer
|
|
|
|
|
|
-class OrdersLocalMVS(viewsets.ModelViewSet):
|
|
|
|
- queryset = OrdersLocal.objects.all()
|
|
|
|
- serializer_class = OrdersLocalSerializer
|
|
|
|
|
|
+
|
|
|
|
+class EventMVS(viewsets.ModelViewSet):
|
|
|
|
+ queryset = Event.objects.all()
|
|
|
|
+ serializer_class = EventSerializer
|
|
#permission_classes = [IsOwnerOrReadOnly]
|
|
#permission_classes = [IsOwnerOrReadOnly]
|
|
permission_classes = [permissions.IsAuthenticated]
|
|
permission_classes = [permissions.IsAuthenticated]
|
|
|
|
|
|
@@ -26,7 +21,7 @@ class OrdersLocalMVS(viewsets.ModelViewSet):
|
|
keyword arguments in the url conf.
|
|
keyword arguments in the url conf.
|
|
"""
|
|
"""
|
|
# queryset = self.filter_queryset(self.get_queryset())
|
|
# queryset = self.filter_queryset(self.get_queryset())
|
|
- queryset = OrdersLocal.objects.select_related('order_synced__ticket')
|
|
|
|
|
|
+ queryset = Event.objects.select_related('order_synced__ticket')
|
|
|
|
|
|
# Perform the lookup filtering.
|
|
# Perform the lookup filtering.
|
|
lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field
|
|
lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field
|
|
@@ -49,7 +44,7 @@ class OrdersLocalMVS(viewsets.ModelViewSet):
|
|
|
|
|
|
def update(self, request, *args, **kwargs):
|
|
def update(self, request, *args, **kwargs):
|
|
partial = kwargs.pop('partial', False)
|
|
partial = kwargs.pop('partial', False)
|
|
- instance = self.get_object()# OrdersLocal.objects.select_related('order_synced__ticket').get(id=1)
|
|
|
|
|
|
+ instance = self.get_object()# Event.objects.select_related('order_synced__ticket').get(id=1)
|
|
serializer = self.get_serializer(instance, data=request.data, partial=partial)
|
|
serializer = self.get_serializer(instance, data=request.data, partial=partial)
|
|
# for serializer in serializers:
|
|
# for serializer in serializers:
|
|
serializer.is_valid(raise_exception=True)
|
|
serializer.is_valid(raise_exception=True)
|
|
@@ -61,9 +56,3 @@ class OrdersLocalMVS(viewsets.ModelViewSet):
|
|
instance._prefetched_objects_cache = {}
|
|
instance._prefetched_objects_cache = {}
|
|
|
|
|
|
return Response(serializer.data)
|
|
return Response(serializer.data)
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|