<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def init(req, model):
 """ Return an array of Filter objects. """


    fields = model.all_fields
    rels = model.relationships
    params = []

    for key, val in req.params.items():
        try:
            field, oper = _parse_param(key)
        except (TypeError, ValueError):
            continue

        try:
            local_field, foreign_filter = field.split('/')
            field_type = getattr(model, local_field)

            foreign_field = field_type.field
            foreign_rtype = field_type.rtype

            if hasattr(field_type, 'local_field'):
                local_field = field_type.local_field

            param = FilterRel(foreign_field, foreign_filter, foreign_rtype,
                              local_field, field, oper, val)
        except AttributeError:
            raise InvalidQueryParams(**{
                'detail': 'The filter query param "%s" specified a filter '
                          'containing a "." indicating a relationship filter '
                          'but a relationship by that name does not exist '
                          'on the requested resource.' % key,
                'links': LINK,
                'parameter': PARAM,
            })
        except ValueError:
            param = Filter(field, oper, val)

        _validate_param(param)
        _validate_rel(param, rels)
        _validate_field(param, fields)
        params.append(param)

    return params