hackens-orga/hackens_orga/wishlist/views.py
2023-02-08 02:04:34 +01:00

17 lines
578 B
Python

from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from .models import Purchase, PurchaseTag
from .serializers import PurchaseSerializer, PurchaseTagSerializer
class PurchaseTagViewSet(viewsets.ModelViewSet):
queryset = PurchaseTag.objects.all()
serializer_class = PurchaseTagSerializer
permission_class = [IsAuthenticatedOrReadOnly]
class PurchaseViewSet(viewsets.ModelViewSet):
queryset = Purchase.objects.all()
serializer_class = PurchaseSerializer
permission_class = [IsAuthenticatedOrReadOnly]