Re: sorting by another table

2008-02-06 Thread Andriy Khavryuchenko
[EMAIL PROTECTED] написав(ла): > I have a Sale model that foreign keys into an APN model, which > foreign keys into a Zip model. I'd like to sort my Sale objects by > the 'zip' field on the Zip model, but > > Sale.objects.select_related().order_by('sales_zip.zip') > > doesn't work (1054, "Unknow

Re: sorting by another table

2008-02-07 Thread Andriy Khavryuchenko
[EMAIL PROTECTED] написав(ла): > > I have a Sale model that foreign keys into an APN model, which > > foreign keys into a Zip model. I'd like to sort my Sale objects by > > the 'zip' field on the Zip model, but > > > > Sale.objects.select_related().order_by('sales_zip.zip') > > > > doesn't work (1