> You have an addiction to dots...if you were doing unit tests, > this would be A Good Thing(tm) :) However, in an ORDER BY > clause, not so much.
I wouldn't cause it an addiction as such. I may occasionally use them a little more than is good for me...:-) > > IIUC, you need to do a select_related() to attach the various > tables to the query, and then you need to refer to the actual > table that contains the "name" on which you sort. This would > most likely be something like > > camp.application_set.select_related().filter( > year=year_filter).order_by('camps_wing.name') This works. Thank you very much indeed. Interesting. When I read the documentation about select_related() : " This is a performance booster which results in (sometimes much) larger queries but means later use of foreign-key relationships won't require database queries.", I assumed that "this is a performance booster" meant that I didn't need to worry about it until I had a performance problem, but clearly it does change the behaviour (because taking it out of this line returns me to "OperationalError" land). Chris --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---