TKO/services/backend/shop/views.py
Nikola Kubeczkova 0dc669f1da shop progress
2025-06-20 13:09:19 +02:00

21 lines
487 B
Python

from django.shortcuts import render
from rest_framework.generics import ListAPIView, CreateAPIView
from shop.serializers import ProductSerializer, OrderSerializer
from shop.models import Product
# Create your views here.
class LoadProductsView(ListAPIView):
serializer_class = ProductSerializer
template_name = 'shop/shop.html'
def get_queryset(self):
return Product.objects.all()
class CreateOrderView(CreateAPIView):
serializer_class = OrderSerializer