import django_filters

from .models import Event, Status, Prospect

class ProspectFilter(django_filters.FilterSet):
    region = django_filters.CharFilter(lookup_expr='icontains')
    events = django_filters.ModelMultipleChoiceFilter(
        queryset=Event.objects.all(),
        field_name='events',
    )
    statuses = django_filters.ModelMultipleChoiceFilter(
        queryset=Status.objects.all(),
        field_name='prospectstatus__status',
    )

    class Meta:
        model = Prospect
        fields = ['region', 'events', 'statuses']
