I'm new to Django, creating a website which has multiple forms(mostly check boxes) that need to be filled to submit a task. Models.py
class M1(models.Model):
T1=model.NullBooleanField()
T2= model.NullBooleanField()
class M2(models.Model):
N1=model.NullBooleanField()
N2= model.NullBooleanField()
Forms.py`
class M1Form((forms.ModelForm):
class Meta:
model = M1
fields = ['T1','T2']
widgets=.........
class M2Form((forms.ModelForm):
class Meta:
model = M2
fields = ['N1','N2']
widgets=.........
views.py
def home_page(request):
tmpl_vars = {
'form': M1Form
}
return render(request, 'my_app/test.html',tmpl_vars)
My question is I'm not clear on how to load the forms of M2Form through the views.py. Right now m trying to access it on the webpage and currently only the M1Form variables are visible.