'Parent form not getting values from child form during child object initialization in Django

I created a basic form in django.

class basicform(forms.Form):
    br = ((None,' '),('CSE','CSE'),('ECE','ECE'),('IT','IT'))
    se = ((None,' '),('M','Male'),('F','Female'),('O','Others'))
    secx = ((None,' '),('A','A'),('B','B'),('C','C'),('D','D'))
    roll_no = forms.CharField(required=False,label='Roll No:')
    name = forms.CharField(required=False,label='Name:')
    sex = forms.ChoiceField(required=False,choices=se,label='Gender:')
    branch = forms.ChoiceField(required=False,choices=br,label='Branch:')
    sec = forms.ChoiceField(required=False,choices=secx,label='Section:')

i made another form

class marks(basicform):
    s11 = forms.DecimalField(max_value=100,min_value=0)
    s12 = forms.DecimalField(max_value=100,min_value=0)
    s13 = forms.DecimalField(max_value=100,min_value=0)
    ......
        def __init__(self,*args,**kwargs):
        super(marks,self).__init__(*args,**kwargs)
        self.fields['name'].disabled = True
        self.fields['roll_no'].disabled = True
        self.fields['sex'].disabled = True
        self.fields['branch'].disabled = True
        self.fields['sec'].disabled = True

the issue is, i am taking post data from the base form, and i want that data to be assigned into the child (i.e. marks object)

mark = marks(data = request.POST)

this is what i'm trying to do. keep in mind the post data is from the base class(i.e. basicform), i'm under the assumption that the 'data' parameter would be passed onto the super class and therefore values would be assigned, but that is not the case.

what am i doing wrong?

def create(request):
    global form
    if request.method == 'POST': 
                
        form = basicform(data = request.POST)        
        if form.is_valid():            
            mark = marks(data = request.POST)
            mark.full_clean()
            print(form.cleaned_data)
            print(mark.cleaned_data)

this is an excerpt from my view, here the print statements are for debugging and as i mentioned before, 'form' variable has the values but the 'mark' variable doesn't.

UPDATE: so the issue here seems to be the disabling part, if i comment that piece of code out, mark gets the values.But as soon as i disable the fields, their values vanish.

class marks(basicform):
    s11 = forms.DecimalField(max_value=100,min_value=0)
    s12 = forms.DecimalField(max_value=100,min_value=0)
    s13 = forms.DecimalField(max_value=100,min_value=0)
    ......
        #def __init__(self,*args,**kwargs):
        #super(marks,self).__init__(*args,**kwargs)
        #self.fields['name'].disabled = True
        #self.fields['roll_no'].disabled = True
        #self.fields['sex'].disabled = True
        #self.fields['branch'].disabled = True
        #self.fields['sec'].disabled = True


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source