Don't forget that sort() takes a key argument to sort by an arbitrary
function of the elements, so there's no need to build extra
datastructures:object_list = Word.objects.all().order_by('-product_count')[:100]
object_list.sort(key=lambda w: w.title)--Ned. DavidA wrote: Tom Smith wrote: -- Ned Batchelder, http://nedbatchelder.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~--- |
- Re: sorting QuerySets DavidA
- Re: sorting QuerySets Ned Batchelder
- Re: sorting QuerySets Malcolm Tredinnick

