'Get all field selectors involved with this query'

def fields(self):

    op = self.op
    l = self.left
    r = self.right
    if (op in (self.AND, self.OR)):
        lf = l.fields()
        rf = r.fields()
        return (lf + rf)
    elif (op == self.NOT):
        return l.fields()
    elif isinstance(l, S3FieldSelector):
        return [l.name]
    else:
        return []
