this is my django view.What it basically does is, it gets the checked data from Html view.But I have to loop through each data in the view, or in template so that I can get not only the name of subtest but also it's fields.Subtest is the name of my model,and name is it's field
def create_test_bills(request):
if request.method == 'GET':
selected = request.GET.getlist('selected')
for i in range(0,len(selected)):
a = selected [i]
print(selected)
print(a)
sub_test = Subtest.objects.filter(name=a)
return render(request,'report.html',{'sub_test':sub_test})