You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB

from rest_framework import viewsets
from .models import Product, Employee, Position, StorageLocation, Contractor, SupplyContract, Truck
from .serializers import (
ProductSerializer, EmployeeSerializer, PositionSerializer,
StorageLocationSerializer, ContractorSerializer, SupplyContractSerializer, TruckSerializer
)
class ProductViewSet(viewsets.ModelViewSet):
queryset = Product.objects.all()
serializer_class = ProductSerializer
class EmployeeViewSet(viewsets.ModelViewSet):
queryset = Employee.objects.all()
serializer_class = EmployeeSerializer
class PositionViewSet(viewsets.ModelViewSet):
queryset = Position.objects.all()
serializer_class = PositionSerializer
class StorageLocationViewSet(viewsets.ModelViewSet):
queryset = StorageLocation.objects.all()
serializer_class = StorageLocationSerializer
class ContractorViewSet(viewsets.ModelViewSet):
queryset = Contractor.objects.all()
serializer_class = ContractorSerializer
class SupplyContractViewSet(viewsets.ModelViewSet):
queryset = SupplyContract.objects.all()
serializer_class = SupplyContractSerializer
class TruckViewSet(viewsets.ModelViewSet):
queryset = Truck.objects.all()
serializer_class = TruckSerializer