title: Is there a way to update top level relationship in Django form?
body: <p>I have below models and form.</p>
  <p>Brand &gt; Section &gt; Category &gt; Article.</p>
  <p>I can pull the existing data out of the database however I have hit a wall. I am trying to create a new article or update an existing article but I'm not sure how I can update the brand, then the Section. The Category I can update and it is connected directly to the Article model. I have been thinking about this for a few days now and tried different models but ultimately i can't think of the best way to connect the models and have them update in the model.</p>
  <pre><code>class Brand(models.Model):
      
      def brand_image(instance, filename):
          return 'uploads/brand/{0}/{1}'.format(instance.title, filename)
  
      title = models.CharField(max_length=50, unique=True, blank=True, null=True)
      image = models.ImageField(upload_to=brand_image, null=True, blank=True)
      slug = AutoSlugField(populate_from='title', unique_with='title', blank=True, null=True)
      my_order = models.PositiveIntegerField(default=0, blank=False, null=False)
  
      class Meta:
          ordering = ['my_order']
  
      def __str__(self):
          return self.title or ''
  
      def get_absolute_url(self):
          return reverse('brand-list', kwargs={'brand_slug': self.slug})
      
  
  class Section(models.Model):
      title = models.CharField(max_length=50,unique=True, blank=True,null=True)
      slug = AutoSlugField(populate_from='title', unique_with='title',blank=True,null=True)
      brand = models.ForeignKey(Brand, on_delete=models.CASCADE, related_name='section', blank=False, null=False)
      my_order = models.PositiveIntegerField(default=0, blank=False, null=False)
          
      class Meta:
          ordering = ['my_order']
          
      def __str__(self):
          return self.title or ''
      
      def get_absolute_url(self):
          return reverse('section-list', kwargs={'section_slug': self.slug})
  
  class Category(models.Model):
      title = models.CharField(max_length=50, blank=True,null=True)
      slug = AutoSlugField(populate_from='title', unique_with='title',blank=True,null=True)
      my_order = models.PositiveIntegerField(default=0, blank=False, null=False)
      section = models.ForeignKey(Section, on_delete=models.CASCADE,related_name='category', blank=False ,null=False)    
      class Meta:
          ordering = ['my_order']
          
      def __str__(self):
          return self.title or ''
      
      def get_absolute_url(self):
          return reverse('category-list', kwargs={'category_slug': self.slug})
  
  class Article(models.Model):
      title = models.CharField(max_length=100, unique=True, db_index=True)
      description = models.CharField(max_length=100, blank=True, null=False)
      category = models.ForeignKey(Category, on_delete=PROTECT, related_name='article', null=False, default=1)
      slug = AutoSlugField(populate_from='title', unique_with='created__month')
      content = HTMLField(null=True,blank=True)
      internal = models.BooleanField(default=False)
      status = models.CharField(max_length=30, choices=STATUS_CHOICES, default='Draft')
      author = models.ForeignKey(User, related_name='author' ,on_delete=PROTECT,null=True)
      updated_by = models.ForeignKey(User, related_name='updated_by',on_delete=PROTECT,null=True)
      created = models.DateTimeField(auto_now_add=True)
      updated = models.DateTimeField(auto_now=True)
      video = models.FileField(blank=True, null=True, upload_to='articles/videos')
      favourites = models.ManyToManyField(User, related_name='art_favourite', default=None, blank=True)
      tags = TaggableManager(related_name='tags', help_text='Comma or space separated list', blank=True)
      pinned = models.BooleanField(default=False)
      
      def __str__(self) -&gt; str:
          return self.title
      
      def get_absolute_url(self):
          return reverse('articles-detail', kwargs={'article_slug': self.slug})
  
  class ArticleForm(forms.ModelForm):
          
      title = forms.CharField(label='Article Title', max_length=100,)
      description = forms.CharField(label='Description', max_length=100,required=False)
      content = forms.CharField(label='Article Content',widget=CKEditorUploadingWidget(attrs={'cols': 80, 'rows': 30}))
      video = forms.FileField(help_text=&quot;Valid file Extension - .mp4&quot;, required=False, validators=[validate_file_extension])
      category = GroupedModelChoiceField(queryset=Category.objects.exclude(section=None).order_by('section'),choices_groupby='section')
      internal = forms.BooleanField(required=False, help_text='Is this for internal use only?', label='Internal Article')
      class Meta:
          model = Article
          exclude = ['slug','author','created','updated','updated_by','favourites','votes','views','section']
          widgets = {&quot;tags&quot;: TagWidget(attrs={&quot;data-role&quot;: &quot;tagsinput&quot;})}
  </code></pre>
  <p>Any help or guidance would be greatly appreciated.</p>