title: Using Tag model to create ManytoMany relationship
body: <p>I am trying to fetch data where the column value "tag" belongs to list from the table "UserBookmark".</p>
  
  <pre><code>  UserBookmark.objects.filter(tag__in = ['Java','Android'])
  </code></pre>
  
  <p>but this returns QuerySet[](null set) whereas I do have data matching this query in table</p>
  
  <pre><code>&lt;QuerySet [&lt;UserBookmark: 21 user12 http://careers.bankofamerica.com/ [u'Java']&gt;,&lt;UserBookmark: 22 user12 http://aehlke.github.io/tag-it/examples.html [u'Data Science,Python']&gt;,&lt;UserBookmark: 23 user13 https://github.com/Azure/azure-quickstart-templates [u'Android']&gt;, &lt;UserBookmark: 24 user14 https://github.com/sunnykrGupta/Bigquery-series [u'Python']&gt;, &lt;UserBookmark: 25 user14 https://github.com/ctfs/write-ups-2017 [u'Data Analytics']&gt;]&gt;
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>class UserBookmark(models.Model):
      user = models.ForeignKey(User)
      bookmark = models.URLField()
      tag = models.CharField(max_length = 100)
  
      def __str__(self):
          return '%i %s %s %s'%(self.id,self.user,self.bookmark,self.tag)
  </code></pre>
  
  <p>i have modified my models.py </p>
  
  <p>class UserBookmark(models.Model):</p>
  
  <pre><code>user = models.ForeignKey(User)
  bookmark = models.URLField()
  tags = models.ManyToManyField('Tag',blank=True)
  
  def __str__(self):
      return '%i %s %s'%(self.id,self.user,self.bookmark)
  </code></pre>
  
  <p>class Tag(models.Model):</p>
  
  <p>name = models.CharField(max_length=100, unique=True)</p>
  
  <p>But when i run python manae.py migrate after python managepy makemigrations, I get this error:</p>
  
  <p>ValueError: Cannot alter field bookmark.UserBookmark.tags into bookmark.UserBookmark.tags - they are not compatible types (you cannot alter to or from M2M fields, or add or remove through= on M2M fields)</p>
  
  <p>What am i doing wrong here?</p>