'Check one item of `filter_vertical` or `filter_horizontal`, i.e.
check that given field exists and is a ManyToManyField.'

def _check_filter_item(self, obj, model, field_name, label):

    try:
        field = model._meta.get_field(field_name)
    except FieldDoesNotExist:
        return refer_to_missing_field(field=field_name, option=label, model=model, obj=obj, id='admin.E019')
    else:
        if (not field.many_to_many):
            return must_be('a    many-to-many    field', option=label, obj=obj, id='admin.E020')
        else:
            return []
