# coding=utf8
from django_filters import CharFilter
from django.forms import TextInput
from core.orm.filter import BaseFilterSet
from apps.task.models import Task


class ManageTaskFilter(BaseFilterSet):
    state = CharFilter(label='', widget=TextInput(attrs={'class': 'hidden'}))
    search = CharFilter(method='filter_search', label='关键字', widget=TextInput(attrs={'placeholder': '',
                                                                                     'class': 'input-brand x2'}))

    class Meta:
        model = Task
        fields = ['state']
        search_fields = ['name', ]
