python - Looping through multiple variables in view -
views.py counter = 0 house in model... if house.name = house.selected counter++ else: house.correct assumption: correct charfield within house model, looping through multiple houses else condition can entered multiple times.. upon completion end multiple house.corrects prior loop suggestions on type of variables define store values i.e. list = [] when else statement entered can list = house.correct @ end have list potentially multiple character values... way can pass list through use in context. is approach okay or doing poorly ? sorry lack of information give can understand i'm getting at. i'm struggling understand how can grab house.correct values , put them in 1 data type can pass them through context using variable see list of characters. this can better implemented using django orm: from django.db.models import f ... incorrect_list = house.objects.exclude(name=f('selected')).values('correct...