order by on a django paginator page object

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))      


If you want to sort just the current page! I would use the normal python sort method, something like that:

myData = Data.objects.all()   
paginator = Paginator(myData, int(limit))
page = paginator.page(int(page)) 
final_data = sorted(page.object_list, key=lambda k: k['name']) 

To sort using an specify key, just change the lambda!

Some reference: http://wiki.python.org/moin/HowTo/Sorting

Need Your Help

How to read color of a pixel on SWT canvas at mouse pointer?

java canvas swt ubuntu-12.04 mousemove

I wrote a small program to read the colour of a pixel at the mouse pointer location. But I am not getting the colour at mouse pointer, always RGB {0, 0, 0} is printing on console. Please fix/correc...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.