'Given a field name, a optional filter type and an optional list of
additional relations, determine if a field can be filtered on.
If a filter does not meet the needed conditions, it should raise an
``InvalidFilterError``.
If the filter meets the conditions, a list of attribute names (not
field names) will be returned.'

def check_filtering(self, field_name, filter_type=u'exact', filter_bits=None):

    if (filter_bits is None):
        filter_bits = []
    if (field_name not in self._meta.filtering):
        raise InvalidFilterError((u"The    '%s'    field    does    not    allow    filtering." % field_name))
    if (self._meta.filtering[field_name] not in (ALL, ALL_WITH_RELATIONS)):
        if (filter_type not in self._meta.filtering[field_name]):
            raise InvalidFilterError((u"'%s'    is    not    an    allowed    filter    on    the    '%s'    field." % (filter_type, field_name)))
    if (self.fields[field_name].attribute is None):
        raise InvalidFilterError((u"The    '%s'    field    has    no    'attribute'    for    searching    with." % field_name))
    if len(filter_bits):
        if (not getattr(self.fields[field_name], u'is_related', False)):
            raise InvalidFilterError((u"The    '%s'    field    does    not    support    relations." % field_name))
        if (not (self._meta.filtering[field_name] == ALL_WITH_RELATIONS)):
            raise InvalidFilterError((u"Lookups    are    not    allowed    more    than    one    level    deep    on    the    '%s'    field." % field_name))
        related_resource = self.fields[field_name].get_related_resource(None)
        return ([self.fields[field_name].attribute] + related_resource.check_filtering(filter_bits[0], filter_type, filter_bits[1:]))
    return [self.fields[field_name].attribute]
