@classmethod
def filter_for_field(cls, f, name, lookup_type='exact'):
    filter_for_field = dict(FILTER_FOR_DBFIELD_DEFAULTS)
    filter_for_field.update(cls.filter_overrides)
    default = {'name': name, 'label': capfirst(f.verbose_name), 'lookup_type': lookup_type}
    if f.choices:
        default['choices'] = f.choices
        return ChoiceFilter(**default)
    data = filter_for_field.get(f.__class__)
    if (data is None):
        for class_ in f.__class__.mro():
            if (class_ in (f.__class__, models.Field, object)):
                continue
            data = filter_for_field.get(class_)
            if data:
                break
        if (data is None):
            return
    filter_class = data.get('filter_class')
    default.update(data.get('extra', (lambda f: {}))(f))
    if (filter_class is not None):
        return filter_class(**default)
@classmethod
def filter_for_field(cls, f, name, lookup_type='exact'):
    filter_for_field = dict(FILTER_FOR_DBFIELD_DEFAULTS)
    filter_for_field.update(cls.filter_overrides)
    default = {'name': name, 'label': capfirst(f.verbose_name), 'lookup_type': lookup_type}
    if f.choices:
        default['choices'] = f.choices
        return ChoiceFilter(**default)
    data = filter_for_field.get(f.__class__)
    if (data is None):
        for class_ in f.__class__.mro():
            if (class_ in (f.__class__, models.Field, object)):
                continue
            data = filter_for_field.get(class_)
            if data:
                break
        if (data is None):
            return
    filter_class = data.get('filter_class')
    default.update(data.get('extra', (lambda f: {}))(f))
    if (filter_class is not None):
        return filter_class(**default)