IDDRS/App/filters.py
2022-06-27 15:48:56 +02:00

17 lines
523 B
Python

from attr import fields
import django_filters
from .models import *
levels = Level.objects.all().values_list('levelNumber','levelName')
standards = Standards.objects.all().values_list('standardTitle','standardTitle')
class StandardsFilter(django_filters.FilterSet):
level = django_filters.MultipleChoiceFilter(choices=levels)
title = django_filters.MultipleChoiceFilter(choices=standards)
class Meta:
model = SearchResults
fields = ['level','title']
# exclude = ['index','']