title: Detect duplicate inserts when adding many-to-many relation
body: <p>Let's assume there are two models, A and B:</p>
  
  <pre><code>class A(models.Model):
      name = models.CharField(max_length=100)
  
  
  class B(models.Model):
      children = models.ManyToManyField(A)
  </code></pre>
  
  <p>I'm using <code>b.children.add()</code> method to add instance of <strong>A</strong> to <strong>b</strong>:</p>
  
  <pre><code>a = A.objects.get(pk=SOMETHING)
  b.children.add(a)
  </code></pre>
  
  <p>As far as I know, Django by default doesn't allow duplicate many-to-many relationship. So I cannot add same instance of <strong>A</strong> more than once.</p>
  
  <p>But the problem is here, I fetch instances of <strong>A</strong> with another query, then loop around them and add them one by one. How can I detect a duplicate relation? Does <code>add()</code> method return something useful?</p>