title: django model field depend on the value of another field
body: <p>The use case of my application is I will have various fields to fill and among them one is Industry field and another is Segment Field for brand. The industry field is like category that brand falls into. So, if i choose the <code>industry</code> as <code>Health Care</code> for <code>XYZ brand</code> then the <code>segment</code> field should show the items like 'Ayurveda', 'Dental Clinics' (all health care related items). Basically, its like sub-category. </p>
  
  <p>Here is a sample model</p>
  
  <pre><code>class Industry(models.Model):
      name = models.CharField(max_length=150, blank=True, null=True)
  
      class Meta:
          verbose_name = 'Industry'
          verbose_name_plural = 'Industries'
  
      def __str__(self):
          return self.name
  
  
  
  class Segment(models.Model):
      industry = models.ForeignKey(Industry, related_name='segment', on_delete=models.CASCADE)
      name = models.CharField(max_length=150, blank=True, null=True)
  
      class Meta:
          verbose_name = 'Segment'
          verbose_name_plural = 'Segments'
  
      def __str__(self):
          return f'{self.industry.name} - {self.name}'
  
  
  class BusinessModel(models):
      industry = models.ForeignKey(Industry, blank=False, null=False, related_name='industry', on_delete=models.CASCADE)
      # segements = models.ForeignKey()
      total_investment = models.CharField() # will be choice field
  </code></pre>
  
  <p>This is a simple model and I have not created Segment model as I am not sure how to approach to this problem. I am just curios to know, if for such case, do i have to something special in <code>models.py</code> or in the view side. Such type of things get arise during development phase, thus, I want to be clear on problem solving pattern in django.</p>
  
  <p>UPDATE</p>
  
  <p><a href="https://www.franchisebazar.com/franchisor-registration" rel="nofollow noreferrer">https://www.franchisebazar.com/franchisor-registration</a> here if you choose industry inside Business model section, the segment will be updated accordingly.</p>