'Helper method to generate a filter query selector for the
given field(s) in the given resource.
@param resource: the S3Resource
@param fields: the field selectors (as strings)
@return: the field label and the filter query selector, or None
if none of the field selectors could be resolved'

def _selector(self, resource, fields):

    prefix = self._prefix
    label = None
    if (not fields):
        return (label, None)
    if (not isinstance(fields, (list, tuple))):
        fields = [fields]
    selectors = []
    for field in fields:
        if resource:
            try:
                rfield = S3ResourceField(resource, field)
            except (AttributeError, TypeError):
                continue
            if ((not rfield.field) and (not rfield.virtual)):
                continue
            if (not label):
                label = rfield.label
            selectors.append(prefix(rfield.selector))
        else:
            selectors.append(field)
    if selectors:
        return (label, '|'.join(selectors))
    else:
        return (label, None)
