Sorry, I meant to send this to the list. If it's small enough, you can just do a standard python sort:
def sort_function(x, y): return cmp(x.calculated_field, y.calculated_field) query_list = list(queryset) query_list.sort(sort_function) If you want to use a Schwartzian transform for efficiency, just put it in a list: query_list = [(x.calculated_field, x) for x in queryset] query_list.sort() query_list = [x[1] for x in query_list] All of these solutions, however, do not scale as well as they would if you could express them in SQL. Cheers, Mike Axiak On May 24, 8:33 pm, John M <[EMAIL PROTECTED]> wrote: > If I have a model that returns calculated fields, how would I sort a > query set on them? > > Assume the query sets are relatively small (< 100) for now. > > Is this possible? > > Thanks > > john --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---