Re: Quick question about qs-rf and queries using distinct and order_by on foreign key fields

2008-04-23 Thread Matt Hoskins

> There's nothing in the queryset-refactor branch that's really "work in
> progress" any longer (at least not committed to the tree). So please
> open a ticket with a short example so that this doesn't get forgotten.

Thanks Malcolm - I've opened a ticket for it now (number #7070).

Regards,
Matt

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



Re: Quick question about qs-rf and queries using distinct and order_by on foreign key fields

2008-04-22 Thread Malcolm Tredinnick


On Tue, 2008-04-22 at 02:22 -0700, Matt Hoskins wrote:
> I see that in the latest svn checkout of qs-rf if you have a query set
> which has had distinct() called and then order_by() on a foreign key
> field you don't get the ordering on that foreign key field - the
> resulting generated sql query has the joins for the foreign table
> ready to be used for the order_by, but the "if not distinct or elt in
> select_aliases" bit inside get_ordering() prevents the actual ORDER BY
> portion being added.
> 
> I was just wondering if that's a temporary thing due to that section
> of code being work in progress, or whether it will be the case now
> that you can't use distinct with order_by on foreign key fields.

There's nothing in the queryset-refactor branch that's really "work in
progress" any longer (at least not committed to the tree). So please
open a ticket with a short example so that this doesn't get forgotten.

Regards,
Malcolm

-- 
I've got a mind like a... a... what's that thing called? 
http://www.pointy-stick.com/blog/


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



Quick question about qs-rf and queries using distinct and order_by on foreign key fields

2008-04-22 Thread Matt Hoskins

I see that in the latest svn checkout of qs-rf if you have a query set
which has had distinct() called and then order_by() on a foreign key
field you don't get the ordering on that foreign key field - the
resulting generated sql query has the joins for the foreign table
ready to be used for the order_by, but the "if not distinct or elt in
select_aliases" bit inside get_ordering() prevents the actual ORDER BY
portion being added.

I was just wondering if that's a temporary thing due to that section
of code being work in progress, or whether it will be the case now
that you can't use distinct with order_by on foreign key fields.

Thanks,
Matt

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