<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _validate_rel(param, rels):
 """ Validate relationship based filters We don't support nested filters currently. FIX: Ensure the relationship filter field exists on the relationships model! """


    if param.field.count('/') > 1:
        raise InvalidQueryParams(**{
            'detail': 'The filter query param of "%s" is attempting to '
                      'filter on a nested relationship which is not '
                      'currently supported.' % param,
            'links': LINK,
            'parameter': PARAM,
        })
    elif '/' in param.field:
        model_field = param.field.split('/')[0]

        if model_field not in rels:
            raise InvalidQueryParams(**{
                'detail': 'The filter query param of "%s" is attempting to '
                          'filter on a relationship but the "%s" field is '
                          'NOT a relationship field.' % (param, model_field),
                'links': LINK,
                'parameter': PARAM,
            })