Fixes: 1) Simplify Prometheus and GraphQL path definitions in `evibes/api_urls.py`; Extra: 1) Add line breaks across multiple files for improved code readability.
25 lines
1,020 B
Python
25 lines
1,020 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)
|