import django_filters
from django.forms import TextInput

from src.accounts.models import User
from src.application.models import Quiz, StudentGrade


class UserFilter(django_filters.FilterSet):
    username = django_filters.CharFilter(widget=TextInput(attrs={'placeholder': 'username'}), lookup_expr='icontains')
    first_name = django_filters.CharFilter(widget=TextInput(attrs={'placeholder': 'first name'}), lookup_expr='icontains')
    last_name = django_filters.CharFilter(widget=TextInput(attrs={'placeholder': 'last name'}), lookup_expr='icontains')
    email = django_filters.CharFilter(widget=TextInput(attrs={'placeholder': 'email'}), lookup_expr='icontains')

    class Meta:
        model = User
        fields = {
            'is_active': ['exact']
        }

[(9, 'django.forms.TextInput', 'TextInput', False, 'from django.forms import TextInput\n'), (10, 'django.forms.TextInput', 'TextInput', False, 'from django.forms import TextInput\n'), (11, 'django.forms.TextInput', 'TextInput', False, 'from django.forms import TextInput\n'), (12, 'django.forms.TextInput', 'TextInput', False, 'from django.forms import TextInput\n')]