payment modeli yaratildi
This commit is contained in:
25
core/apps/payment/views/payment.py
Normal file
25
core/apps/payment/views/payment.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from django_core.mixins import BaseViewSetMixin
|
||||
from drf_spectacular.utils import extend_schema
|
||||
from rest_framework.permissions import AllowAny
|
||||
from rest_framework.viewsets import ReadOnlyModelViewSet
|
||||
|
||||
from core.apps.payment.models import PaymentModel
|
||||
from core.apps.payment.serializers.payment import (
|
||||
CreatePaymentSerializer,
|
||||
ListPaymentSerializer,
|
||||
RetrievePaymentSerializer,
|
||||
)
|
||||
|
||||
|
||||
@extend_schema(tags=["payment"])
|
||||
class PaymentView(BaseViewSetMixin, ReadOnlyModelViewSet):
|
||||
queryset = PaymentModel.objects.all()
|
||||
serializer_class = ListPaymentSerializer
|
||||
permission_classes = [AllowAny]
|
||||
|
||||
action_permission_classes = {}
|
||||
action_serializer_class = {
|
||||
"list": ListPaymentSerializer,
|
||||
"retrieve": RetrievePaymentSerializer,
|
||||
"create": CreatePaymentSerializer,
|
||||
}
|
||||
Reference in New Issue
Block a user