My problem is that I need to sort on a field in a another table.  I
found a workaround:

File.objects.select_related().filter(...).order_by('app_table.column')

It works for me because the foreign key cannot be NULL.

Vincent.

On Jul 11, 6:27 pm, Drasty <[EMAIL PROTECTED]> wrote:
> Have you tried using the <a href="http://www.djangoproject.com/
> documentation/db-api/#order-by-fields">order_by</a> method on your
> queries?
>
> Even though it may get cumbersome, you could also add something along
> these lines to your url.py file for each specific query you might want
> to call:
>
> def some_list():
>      return Model.objects.all().order_by('some_field')


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