On Sep 12, 2008, at 6:05 AM, Malcolm Tredinnick wrote:
> > > On Thu, 2008-09-11 at 17:27 -0400, Steve Holden wrote: > [...] >> I've got some timings lying around somewhere that clearly show the >> decorate/sort/undecorate implementation is way faster under normal >> circumstances. > > True. That's a very important point. Even in the good old days before > sort() developed the key parameter, decorate-sort-undecorate was The > Way > To Do It in so many cases. Python's sorting is *fast* for simple > objects. > > That's a much better motivation than my technical argument of why it > will interfere with __eq__. The answer's clear then! Thanks to both of you for the explanations. I'm leaning towards sorting with key=lambda x: getattr(x, x._meta.ordering[0].strip('-')) since that's basically what I was after to begin with. Thanks, Eric > > > Regards, > Malcolm > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---