I want to pass tuple to this function but i am getting error
mytuple = [('id', 'name','author')]
mybooks = Book.objects.values_list(mytuple)
error is
'list' object has no attribute 'split'
I want to pass tuple to this function but i am getting error
mytuple = [('id', 'name','author')]
mybooks = Book.objects.values_list(mytuple)
error is
'list' object has no attribute 'split'
You should use:
mytuple = ('id', 'name', 'author')
mybooks = Book.objects.values_list(*mytuple)