import sys, django_filters, json, io


class TaskFilter(django_filters.FilterSet):
    tag = django_filters.CharFilter(name='tags__name', lookup_type='iexact')
university = django_filters.NumberFilter(name='poster__university',
    lookup_type='exact')


class Meta:
    model = Task
fields = {'poster': ['exact'], 'tasker': ['exact'], 'status': ['exact'],
    'created': ['lt', 'gt']}
фильтр фреймворка django rest