title: How to fix "the model is used as in intermediate model but it does not have foreign key to a model"?
body: <p>Error Message:</p>
  
  <pre class="lang-py prettyprint-override"><code>blogs.Permission: (fields.E336) The model is used as an intermediate model by 'blogs.Category.permission', but it does not have a foreign key to 'Category' or 'Permission'.
  </code></pre>
  
  <p>I have tried to add a Foreign Key to 'Category' under Permission model, same error still occurs.</p>
  
  <p>models.py:</p>
  
  <pre class="lang-py prettyprint-override"><code>from django.db import models
  
  class Category(models.Model):
      name = models.CharField(max_length=50)
      permission = models.ManyToManyField('Permission',
                                          related_name='category_permissions',
                                          through='Permission'
                                          )
  
      def __str__(self):
          return self.name
  
  
  class Permission(models.Model):
      HIGH = 'High'
      MEDIUM = 'Medium'
      LOW = 'Low'
      CLASSIFICATION_CHOICES = [
          (HIGH, 'High'),
          (MEDIUM, 'Medium'),
          (LOW, 'Low')
      ]
      category_name = models.ForeignKey(Category, on_delete=models.CASCADE, related_name='category_name')
      name = models.CharField(max_length=100)
      description = models.TextField()
      platform = models.CharField(
          max_length=10,
          choices=PLATFORM_CHOICES,
          default=BOTH,
      )
      classification = models.CharField(
          max_length=10,
          choices=CLASSIFICATION_CHOICES,
          default=LOW,
      )
  
      def __str__(self):
          return self.name
  
  
  class MobileApp(models.Model):
      name = models.CharField(max_length=200)
      icon = models.ImageField(upload_to='app_icons', blank=True, null=True)
      platform = models.CharField(
          max_length=10,
          choices=PLATFORM_CHOICES,
          default=IOS,
      )
      category = models.ManyToManyField('Category')
      provider = models.CharField(max_length=200)
      identifier = models.CharField(max_length=200)
      permission = models.ManyToManyField(Permission,
                                          related_name='mobile_app_permission',
                                          )
  
      def __str__(self):
          return self.name
  
  </code></pre>
  
  <p>I am trying to use 'through' argument to include the description field of the permission m2m for MobileApp and Category</p>