from django_filters import rest_framework as filters
from .models import *

class CertAppFilter(filters.FilterSet):
    noproject = filters.BooleanFilter(field_name='project', lookup_expr='isnull')
    class Meta:
        model = CertApp
        fields = ['status', 'noproject']

class ProjectFilter(filters.FilterSet):
    planoff = filters.BooleanFilter(field_name='plan', lookup_expr='isnull')
    class Meta:
        model = Project
        fields = ['plan', 'planoff', 'status', 'certapp_project__member_certapp__user']