from django_filters import rest_framework as filters
from django.db.models import Count
from app.entities.models import AllowedCompany
from django.db.models import Q


class AllowedCompanyFilterSet(filters.FilterSet):
    # search = filters.CharFilter(method='search_bar', label='search')
    # def search_bar(self, queryset, name, value):
    #     return queryset.filter(
    #         Q(username__icontains=value) |
    #         Q(first_name__icontains=value) |
    #         Q(last_name__icontains=value))
    
    class Meta:
        model = AllowedCompany
        fields = '__all__'
