code: def union_q(token):
      
      query = Q()
      operation = 'and'
      negation = False
  
      for t in token:
          if type(t) is ParseResults:  # See tokens recursively
              query &= union_q(t)
          else:
              if t in ('or', 'and'):  # Set the new op and go to next token
                  operation = t
              elif t == '-':  # Next tokens needs to be negated
                  negation = True
              else:  # Append to query the token
                  if negation:
                      t = ~t
                  if operation == 'or':
                      query |= t
                  else:
                      query &= t
      return query
docs: Appends all the Q() objects.