# views.py
from rest_framework import viewsets
from .models import Product, ProductFeature, ProductDescription, ProductImage, Category
from .serializers import (
    ProductSerializer,
    ProductFeatureSerializer,
    ProductDescriptionSerializer,
    ProductImageSerializer,
    CategorySerializer,
)

class ProductCategoryView(viewsets.ModelViewSet):
    queryset = Category.objects.all()
    serializer_class = CategorySerializer 


class ProductViewSet(viewsets.ModelViewSet):
    queryset = Product.objects.all()
    serializer_class = ProductSerializer                           # [web:36]


class ProductFeatureViewSet(viewsets.ModelViewSet):
    queryset = ProductFeature.objects.all()
    serializer_class = ProductFeatureSerializer                    # [web:36]


class ProductDescriptionViewSet(viewsets.ModelViewSet):
    queryset = ProductDescription.objects.all()
    serializer_class = ProductDescriptionSerializer                # [web:36]


class ProductImageViewSet(viewsets.ModelViewSet):
    queryset = ProductImage.objects.all()
    serializer_class = ProductImageSerializer                      # [web:36]
