I have a model with a m2m field "provincia".
I want to order my objects in this way:
If the object has a provincia = 'AA' on m2m relation must be the
bottom of my list.

I tried query = query.order_by('-provincia') and it works correctly
(because AA is the first of the values), but I duplicates the results
because of multiple m2m relationships:
If an object has both "FC" and "BO" in provincia, I will have 2
objects in queryset also If I use distinct().

Is there a solution?

-- 
Alessandro Ronchi
Skype: aronchi
http://www.alessandroronchi.net

SOASI Soc.Coop. - www.soasi.com
Sviluppo Software e Sistemi Open Source
Sede: Via Poggiali 2/bis, 47100 Forlì (FC)
Tel.: +39 0543 798985 - Fax: +39 0543 579928

Rispetta l'ambiente: se non ti è necessario, non stampare questa mail

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