schon/payments/viewsets.py
Egor fureunoir Gorbunov 7ff62cea0e Features: 1) Add detailed class-level docstrings for multiple ViewSets and views, improving maintainability and documentation; 2) Introduce namespace for "core_b2b" in URL patterns for better URL resolution.
Fixes: 1) Remove unused "prometheus/" URL pattern for cleanup.

Extra: Update imports and formats for consistency; refine sitemap functions with explicit docstrings.
2025-06-29 19:56:52 +03:00

24 lines
1,019 B
Python

from rest_framework.viewsets import ReadOnlyModelViewSet
from core.permissions import EvibesPermission, IsOwner
from payments.serializers import TransactionSerializer
class TransactionViewSet(ReadOnlyModelViewSet):
"""
ViewSet for handling read-only operations on Transaction model.
This class provides a read-only interface for interacting with transaction
data. It utilizes the TransactionSerializer for serializing and deserializing
the data. The class ensures that only authorized users, who meet specific
permissions, can access the transactions.
Attributes:
serializer_class: Specifies the serializer class to be used for
serializing transaction data.
permission_classes: A tuple specifying the permissions required to access
the data. Includes custom permissions to restrict access based
on ownership and other criteria.
"""
serializer_class = TransactionSerializer
permission_classes = (EvibesPermission, IsOwner)