title: Django - Q.add() weird behavior when using operator OR
body: <p>So, I'm trying to join a bunch of Q() queries, and in particular I want the operator to be user-defined. </p>
  
  <p>In order to do that nicely I'm trying to use the Q.add(Q, operator) function, with operator received as input. </p>
  
  <p>But I have ran into a weird behaviour when trying to set the operator as OR, as described below:</p>
  
  <pre><code>q_1 = Q(field_one__id=5)
  q_2 = Q(field_two__name='foo')
  print q_1
  &gt; (AND: ('field_one__id', 5))
  print q_2
  &gt; (AND: ('field_two__name','foo'))
  q_1_and_q_2 = Q()
  q_1_or_q_2 = Q()
  
  q_1_and_q_2.connector = q_1_and_q_2.AND # This is the default operator but just in case.
  q_1_or_q_2.connector = q_1_or_q_2.OR
  
  # joining both versions using q.add() with the pre-set operator. clone() is used to avoid overriding q_1.
  q_1_and_q_2 = q_1.clone().add(q_2, q_1_and_q_2.connector)  
  
  q_1_or_q_2 = q_1.clone().add(q_2, q_1_or_q_2.connector)
  
  #printing q_1_and_q_2 works as expected:
  print q_1_and_q_2
  &gt; (AND: ('field_one__id', 5), ('field_two__name','foo'))
  
  #But printing q_1_or_q_2 shows that q_1 was overridden by q_2
  print q_1_or_q_2 
  &gt; (AND: ('field_two__name','foo'))
  </code></pre>
  
  <p>Does anybody know why this might happen so?</p>
  
  <p>I think a decent bypass would look like this:</p>
  
  <pre><code>from operator import or_, and_
  if user_says_op == 'OR':
      op = or_
  else:
      op = and_
  q_1_with_q_2_operator_as_input = op(q_1,q_2)
  </code></pre>
  
  <p>But it feels wrong to do that and I'd rather use <code>Q.add()</code> if possible.</p>