views.py 467 B

12345678910111213
  1. from django.shortcuts import render
  2. from rest_framework import viewsets, permissions
  3. from apps.indicatortype.models import IndicatorType
  4. from apps.indicatortype.serializers import IndicatorTypeSerializer
  5. class IndicatorTypeViewSet(viewsets.ReadOnlyModelViewSet):
  6. queryset = IndicatorType.objects.all()
  7. serializer_class = IndicatorTypeSerializer
  8. permission_classes = [
  9. permissions.IsAuthenticatedOrReadOnly # Or anon users can't register
  10. ]