title: Django LEFT JOIN?
body: <p>I have models, more or less like this:</p>
  
  <pre><code>class ModelA(models.Model):
      field = models.CharField(..)
  
  class ModelB(models.Model):
      name = models.CharField(.., unique=True)
      modela = models.ForeignKey(ModelA, blank=True, related_name='modelbs')
  
      class Meta:
          unique_together = ('name','modela')
  </code></pre>
  
  <p>I want to do a query that says something like: "Get all the ModelA's where field name equals to X that have a ModelB model with a name of X OR with no model name at all"</p>
  
  <p>So far I have this:</p>
  
  <pre><code>ModelA.objects.exclude(field=condition).filter(modelsbs__name=condition)
  </code></pre>
  
  <p>This will get me all the ModelAs that have at least one modelB (and in reality it will ALWAYS be just one) - but if a ModelA has no related ModelBs, it will not be in the result set. I need it to be in the resultset with something like obj.modelb = None</p>
  
  <p>How can I accomplish this?</p>