0

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'
tej.tan
  • 4,067
  • 6
  • 28
  • 29

1 Answers1

9

You should use:

mytuple = ('id', 'name', 'author')
mybooks = Book.objects.values_list(*mytuple)
David Wolever
  • 148,955
  • 89
  • 346
  • 502