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

17 lines
588 B
Python

from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from .models import BudgetGroup, BudgetLine
from .serializers import BudgetGroupSerializer, BudgetLineSerializer
class BudgetGroupViewSet(viewsets.ModelViewSet):
queryset = BudgetGroup.objects.all()
serializer_class = BudgetGroupSerializer
permission_class = [IsAuthenticatedOrReadOnly]
class BudgetLineViewSet(viewsets.ModelViewSet):
queryset = BudgetLine.objects.all()
serializer_class = BudgetLineSerializer
permission_class = [IsAuthenticatedOrReadOnly]