title: How to create django model dependencies?
body: <p>I'm creating a django rest api for wiki application, 
  for now, I'm thinking of creation of 3 models:</p>
  
  <ol>
  <li>MainCategory -> Linux or Windows</li>
  <li>SubCategory for each operating system with a list of categories </li>
  <li>WikiContent for each SubCategory </li>
  </ol>
  
  <p>My problem that I don't know how to do in the right way because I want that for each category I will see only categories that depend on and not all the categories and WikiContent will see depends on which category the user chose. 
  Thanks for the help.</p>
  
  <pre><code>class Category(models.Model):
  TYPE_CHOICES = (
      ('Linux', 'Linux'),
      ('Windows', 'Windows')
  )
  
  name = models.CharField(
      max_length=10,
      choices=TYPE_CHOICES,
      default='Linux',
  )
  
  def __str__(self):
      return self.name
  </code></pre>
  
  <p>class SubCategoryLinux(models.Model):</p>
  
  <pre><code># TYPE_CHOICES_LINUX = (
  #     ('Installs', 'Installs'),
  #     ('Sysaid', 'Sysaid'),
  #     ('DataBase', 'DataBase'),
  #     ('Docker', 'Docker'),
  #     ('Devops', 'Devops'),
  #     ('Linux Hardware', 'Linux Hardware'),
  #     ('Programming', 'Programming'),
  #     ('Monitoring', 'Monitoring')
  # )
  
  # TYPE_CHOICES_WIN = (
  #     ('Installs','Installs'),
  #     ('Sysaid', 'Sysaid')
  # )
  
  name = models.CharField(max_length=100)
  category = models.ForeignKey(Category, on_delete=models.CASCADE, related_name='category')
  
  
  
  def __str__(self):
      return self.name
  </code></pre>
  
  <p>class Content(models.Model):</p>
  
  <pre><code>title = models.CharField(max_length=255, unique=True)
  category = models.ForeignKey(Category, on_delete=models.CASCADE, related_name='category')
  sub_category = models.ForeignKey(SubCategory, on_delete=models.CASCADE, related_name='sub_category')
  created_at = models.DateTimeField(auto_now_add=True)
  updated_at = models.DateTimeField(null=True)
  content = models.TextField(max_length=40000)
  
  def __str__(self):
      return self.title
  </code></pre>