I have a function that I'm using and I need to pass it a list of arguments, however, it gives an error when I try to pass the list because it can't hash.
The function in question here is the values() method on a Django Queryset, but I think this is a more general python question.
So I have:
values_list = ['arg1', 'arg2', 'arg3']
models.MyModel.objects.values(values_list).all()
This gives an error unhashable type: 'list'
when i try to run the code.
Assuming that I can't alter the values method, how can I add this list to the arguments list in the normal manner?
for arg in values_list:
queryset = MyModel.objects.values(arg)