How can I choose by what var value that I get by filter that then to append a value in the loop?
items = Item.objects.filter(Q(var__icontains=term) | Q(another_var__icontains=term))
res = []
for item in items:
res.append({
'val': item.(var or another_var?),
})