17 lines
588 B
Python
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]
|