import django_filters
from django.utils.translation import gettext_lazy as _

from .models import Member


class MemberFilter(django_filters.FilterSet):
    user__first_name = django_filters.CharFilter(field_name="user__first_name", label=_("First name"))
    user__last_name = django_filters.CharFilter(field_name="user__last_name", label=_("Last name"))
    license = django_filters.CharFilter(label=_("License"), lookup_expr="icontains")
    
    class Meta:
        model = Member
        fields = ["user__first_name", "user__last_name", "license"]
        
    