I have a checkbox where I am selecting variables for django filter values.
I am getting the values correctly so if I replace *values with pfast_type[0] or pfast_type[1] it works fine.
But What I want to do is that if I select 3 variables checkbox I want this entered like pfast_type[0], pfast_type[1] and pfast_type[2], if I select one 1 variable it should be only pfast_type[0] for the values.
Where am I going wrong?
Maybe I am searching poorly but I searched and couldn't find any reference information within the StackOverflow.
pfast_type = request.GET.getlist("pfast_type")
elif pfast_type and items:
for pfast_type in range(len(pfast_type)):
values= values.append(pfast_type[i])
object_list = FP.objects.filter(pk__in=items).values('RFP_Item',*values)