IDDRS/App/filters.py

17 lines
523 B
Python
Raw Permalink Normal View History

2022-06-17 12:06:51 +00:00
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','']