'Render the filterby-options as Query to apply when retrieving
the existing rows in this inline-component'

def _filterby_query(self):

    filterby = self.options['filterby']
    if (not filterby):
        return
    if (not isinstance(filterby, (list, tuple))):
        filterby = [filterby]
    component = self.resource.components[self.selector]
    table = component.table
    query = None
    for f in filterby:
        fieldname = f['field']
        if (fieldname not in table.fields):
            continue
        field = table[fieldname]
        if ('options' in f):
            options = f['options']
        else:
            continue
        if ('invert' in f):
            invert = f['invert']
        else:
            invert = False
        if (not isinstance(options, (list, tuple))):
            if invert:
                q = (field != options)
            else:
                q = (field == options)
        elif invert:
            q = (~ field.belongs(options))
        else:
            q = field.belongs(options)
        if (query is None):
            query = q
        else:
            query &= q
    return query
