from django_filters import rest_framework as filters
from .models import ExamRecord, Exam
class ExamRecordFilter(filters.FilterSet):
    class Meta:
        model = ExamRecord
        fields = {
            'start_time': ['exact', 'gte', 'lte'],
            'is_pass': ['exact'],
            'type': ['exact'],
            'is_submited': ['exact'],
        }

class ExamFilter(filters.FilterSet):
    class Meta:
        model = Exam
        fields = {
            'close_time': ['exact', 'gte', 'lte'],
            'paper': ['exact'],
            'code': ['exact'],
            'is_open': ['exact']
        }