How to pass tuple as argument to django function
I want to pass tuple to this function but i am getting error
mytuple = [('id', 'name','author')]
myboo开发者_运维知识库ks = 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)
精彩评论