How can I run an order_by on myFinalData? I need to do it after pagination or the pages sort don’t make sense
myData = Data.objects.all()
paginator = Paginator(myData, int(limit))
myFinalData = paginator.page(int(page))
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to sort just the current page! I would use the normal python sort method, something like that:
To sort using an specify key, just change the lambda!
Some reference: http://wiki.python.org/moin/HowTo/Sorting