[Answered ]-How would I make Django form fields have children?

2👍

The problem is that you’re outputting fields not associated with any forms.

I’ll suggest you to create the dictionary overriding the __init__ method of the form:

def __init__(self, *args, **kwargs):
    super(DetailForm, self).__init__(*args, **kwargs)
    self.fields_dict = {self['a']: [self['a1']],
                   self['b']: [self['b1'], self['b2']],
                   self['c']: [self['c1'], self['c2'], self['c3']]
                  }

Hope this helps!

Leave a comment