text: import django_filters
  
  from .models import Title
  
  
  class TitleFilter(django_filters.FilterSet):
      name = django_filters.CharFilter(lookup_expr='icontains')
      genre = django_filters.CharFilter(field_name='genre__slug')
      category = django_filters.CharFilter(field_name='category__slug')
      year = django_filters.NumberFilter(field_name='year')
  
      class Meta:
          model = Title
          fields = ('genre', 'category', 'name', 'year')
  