title: Django ManyToMany relation add() error
body: <p>I've got a model that looks like this,</p>
  
  <pre><code>class PL(models.Model):
      locid = models.AutoField(primary_key=True)
      mentionedby = models.ManyToManyField(PRT)
  
  class PRT(models.Model):
      tid = ..
  </code></pre>
  
  <p>The resulting many to many table in mysql is formed as,</p>
  
  <pre><code>+------------------+------------+------+-----+---------+----------------+
  | Field            | Type       | Null | Key | Default | Extra          |
  +------------------+------------+------+-----+---------+----------------+
  | id               | int(11)    | NO   | PRI | NULL    | auto_increment | 
  | PL_id            | int(11)    | NO   | MUL | NULL    |                | 
  | PRT_id           | bigint(64) | NO   | MUL | NULL    |                | 
  +------------------+------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>Now, if pl is an object of PL and prt that of PRT, then doing</p>
  
  <pre><code>pl.mentionedby.add(prt)
  </code></pre>
  
  <p>gives me an error</p>
  
  <blockquote>
    <p>Incorrect integer value: 'PRT object'
    for column 'prt_id' at row 1"</p>
  </blockquote>
  
  <p>whereas </p>
  
  <pre><code>pl.mentionedby.add(prt.tid) 
  </code></pre>
  
  <p>works fine - with one caveat.</p>
  
  <p>I can see all the elements in <code>pl.mentionedby.all()</code>, but I can't go to a mentioned PRT object and see its <code>prt.mentionedby_set.all()</code>.</p>
  
  <p>Does anyone know why this happens? Whats the best way to fix it?</p>
  
  <p>Thanks!</p>