uncloud-mravi/uncloud/ungleich_service/views.py

17 lines
576 B
Python

from rest_framework import viewsets, permissions
from .models import MatrixServiceProduct
from .serializers import MatrixServiceProductSerializer
from uncloud_pay.helpers import ProductViewSet
class MatrixServiceProductViewSet(ProductViewSet):
permission_classes = [permissions.IsAuthenticated]
serializer_class = MatrixServiceProductSerializer
def get_queryset(self):
return MatrixServiceProduct.objects.filter(owner=self.request.user)
def create(self, request):
# TODO: create order, register service
return Response('{"HIT!"}')