import sform

from intranet.femida.src.api.core.forms import CityMultipleSuggestField
from intranet.femida.src.candidates.filters.fields.base import register_filter
from intranet.femida.src.candidates.filters.fields.base.multiple import MultipleChoiceFilter
from intranet.femida.src.candidates.models import CandidateCity


@register_filter
class CityFilter(MultipleChoiceFilter):

    model_class = CandidateCity
    model_value_attr = 'city'
    values_field = CityMultipleSuggestField(state=sform.REQUIRED)
