None of the documented method works for me:
The only way I found to make it works (affter having suffered a lot)
is:
MyRelatedModel.objects.all().extra(
select={'my_field':
'SELECT my_field
FROM myapplication_mymodel
WHERE myapplication_mymodel.id =
myapplication_myrelatedmodel.mymodelfk_id'}
).order_by('my_field')
Explanation: the .extra(select={'extra_field_name':'some sql join
query'}) method add an extra field to the query set which can then be
used to order it.
HTH
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---