it occured before on the mailing list...

if you add select_related(), it will work...

the problem is that specifying ordering like this doesn't force the
join in the query so you might end up with a query that sorts on
something that just isn't there...

On 1/23/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote:
>
> Hello Everyone,
>
>
> Trying this:
>
>         Book.objects.all().order_by('-app_statistics.avg_rating')
>
> I get:
>
>         ProgrammingError at /bleep/
>         ERROR: missing FROM-clause entry for table "app_statistics"
>         at character 375....
>
> Anyone know what the problem is? (working with trunk, updated today). I
> saw some tickets related to this but they all seemed rather old.
>
>
> thanks!
>
>
>   - bram
>
> >
>


-- 
Honza Kr�l
E-Mail: [EMAIL PROTECTED]
ICQ#:   107471613
Phone:  +420 606 678585

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to