Borrowing-TrackerBackend/equipment_tracker/transactions/views.py

14 lines
480 B
Python
Raw Normal View History

from rest_framework.permissions import IsAuthenticated
from rest_framework import viewsets, generics
from .serializers import TransactionSerializer
from .models import Transaction
class TransactionViewSet(viewsets.ModelViewSet):
# Only allow GET, POST/CREATE
# Transactions cannot be deleted
2023-12-16 15:00:13 +08:00
http_method_names = ['get', 'post', 'patch']
permission_classes = [IsAuthenticated]
serializer_class = TransactionSerializer
queryset = Transaction.objects.all()