I am getting order_by fields in the form of a list. I want to order_by by multiple fields with django orm. List is like below:
orderbyList = [\'check-in\',\'
Pass orders list in query parameters eg : yourdomain/?order=location&order=check-out
orderbyList = ['check-in'] #default order if request.GET.getlist('order'): orderbyList = request.GET.getlist('order') modelclassinstance.objects.all().order_by(*orderbyList)