from rest_framework.generics import ListAPIView from rest_framework.permissions import AllowAny from .models import Atoll from .serializers import AtollSerializer class AtollListView(ListAPIView): """Public: the registration form needs this before anyone has a token.""" authentication_classes = [] permission_classes = [AllowAny] serializer_class = AtollSerializer pagination_class = None def get_queryset(self): return Atoll.objects.filter(is_active=True).prefetch_related("islands")