RE: sorting by another table

2008-02-07 Thread charles.wesley
: sorting by another table On Feb 6, 3:50 pm, <[EMAIL PROTECTED]> wrote: > 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 > >

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

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-06 Thread Rajesh Dhawan
On Feb 6, 3:50 pm, <[EMAIL PROTECTED]> wrote: > 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') > > does

sorting by another table

2008-02-06 Thread charles.wesley
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, "Unknown column 'sales_zip.zip' in 'order