I found a way.

Using the extra() directive, I create another field, e.g. is_new. 
I then can use this as a sort criteria. There's no need to 
output this field:

  list = Device.objects
        .extra(select={'is_new': 'name LIKE "New Device%%"'})
        .order_by('-is_new', 'parent', 'name')

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

Reply via email to