On Thu, 2007-06-21 at 06:41 -0700, greg wrote:
> Hi,
> 
> Please help me !
> 
> I just wanna know how to order my queryset by lowering my field
> before, like in SQL (ORDER BY LOWER(my_field) 'cause in this field
> I've upper et lower case and by default my result is not sorted as I
> want.

At the moment you cannot do this with the order_by field or any ordering
options on a Queryset. The reason is because all the ordering is done at
the database level and there is no way to pass through functions like
LOWER() to that level.

You could try sub-clasing QuerySet and adding extra code to do that. Off
the top of my head, I'm not sure how hard that would be to do, or even
if it's possible.

The alternative is to sort the results in Python.

Regards,
Malcolm



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