|
|
@@ -1,4 +1,6 @@
|
|
|
+import django_filters
|
|
|
from django.shortcuts import render
|
|
|
+from django_filters.rest_framework import DjangoFilterBackend
|
|
|
from rest_framework import viewsets
|
|
|
|
|
|
from apps.indicator.models import Indicator
|
|
|
@@ -23,3 +25,8 @@ class IndicatorViewSet(viewsets.ModelViewSet):
|
|
|
# return obj
|
|
|
|
|
|
serializer_class = IndicatorSerializer
|
|
|
+ filter_backends = [DjangoFilterBackend]
|
|
|
+ filterset_fields = ['type']
|
|
|
+
|
|
|
+
|
|
|
+# https://www.django-rest-framework.org/api-guide/filtering/
|