|
@@ -5,7 +5,7 @@ from rest_framework.views import APIView
|
|
|
from rest_framework.viewsets import ModelViewSet
|
|
|
|
|
|
from basic.models import Menu
|
|
|
-from basic.serializer import MenuSerializer
|
|
|
+from basic.serializer import MenuSerializer, RouterMenuSerializer, GroupRouterMenuSerializer
|
|
|
from payment.models import Payment
|
|
|
|
|
|
|
|
@@ -21,3 +21,15 @@ class StatisticsView(APIView):
|
|
|
data = list(
|
|
|
Payment.objects.values('payment_type').annotate(price_sum=Sum('index_price')).order_by('-price_sum'))
|
|
|
return Response(data, status=status.HTTP_200_OK)
|
|
|
+
|
|
|
+
|
|
|
+class GroupRouterMenuView(APIView):
|
|
|
+ queryset = Menu.objects.all()
|
|
|
+ serializer_class = GroupRouterMenuSerializer
|
|
|
+ pagination_class = None
|
|
|
+
|
|
|
+
|
|
|
+class RouterMenuView(ModelViewSet):
|
|
|
+ queryset = Menu.objects.all()
|
|
|
+ serializer_class = RouterMenuSerializer
|
|
|
+ pagination_class = None
|