django-orchestra-test/orchestra/contrib/orders/api.py

16 lines
376 B
Python
Raw Normal View History

2023-07-09 07:51:51 +00:00
from rest_framework import viewsets
from orchestra.api import router
from orchestra.contrib.accounts.api import AccountApiMixin
from .models import Order
from .serializers import OrderSerializer
class OrderViewSet(AccountApiMixin, viewsets.ModelViewSet):
queryset = Order.objects.all()
serializer_class = OrderSerializer
router.register(r'orders', OrderViewSet)