mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 21:45:41 +00:00
12 lines
375 B
Python
12 lines
375 B
Python
from rest_framework import viewsets, permissions
|
|
from .models import Product
|
|
from .serializers import ProductSerializer
|
|
|
|
class ProductViewSet(viewsets.ModelViewSet):
|
|
queryset = Product.objects.all()
|
|
serializer_class = ProductSerializer
|
|
permission_classes = [permissions.IsAuthenticatedOrReadOnly]
|
|
|
|
def get_queryset(self):
|
|
return Product.objects.all()
|