title: LEFT JOIN with OR condition in python django
body: <p>All I want is to write the following SQL query in Python Django syntax. I researched a lot but could not get the result I want. Could you please help me.</p>
  
  <pre><code>    SELECT * FROM thread
      LEFT JOIN user
      ON (thread.user1_id = user.id OR thread.user2_id = user.id)
      WHERE user.id = 9
  </code></pre>
  
  <p>My model:</p>
  
  <pre><code> class Thread(models.Model):
          last_message = models.TextField(max_length=100)
          user1_id = models.IntegerField()
          user2_id = models.IntegerField()
  </code></pre>