text: from django.conf import settings
  from django_filters.rest_framework import DjangoFilterBackend
  from rest_framework import filters, permissions, viewsets
  
  from ..models import CartellaPagamento
  from ..serializers import CartellaPagamentoSerializer
  
  permission = permissions.AllowAny if settings.DEBUG else permissions.IsAuthenticated
  
  
  class CartellaPagamentoViewSet(viewsets.ModelViewSet):
      permission_classes = [permission]
      queryset = CartellaPagamento.objects.all()
      serializer_class = CartellaPagamentoSerializer
      filter_backends = [filters.SearchFilter, DjangoFilterBackend]
      filterset_fields = ["soggetto_fiscale"]
      search_fields = ["numero"]
  