You have two choices. Either you can add .exclude() using the __in to avoid get the duplicates in the first place. Or you could iterate over the 3 pubs and append them to a list with an if statement. Something like this: list = [] for pub in publications123: If pub not in list: list.append(pub)
On 25 Feb., 21:54, Jesse <adles...@gmail.com> wrote: > > I believe this would work: > > > publications = Publication.objects.filter(techpubcombo__technology=t) > > > Regards, > > > -- > > Christian Joergensenhttp://www.technobabble.dk > > Hello Christian, > > Thank you so much for your answer. I have been struggling with the > users group to get that syntax (I must not have been explaining it > well enough). Now I need the syntax for the next step, which I'm > hoping you can help with. > > I have three statements: > publications = Publication.objects.filter(techpubcombo__technology=t) > publications2 = Publication.objects.filter(pathpubcombo__pathology=p) > publications3 = Publication.objects.filter(commpubcombo__commodity=c) > > I need to combine the three sets into one set to eliminate duplication > in the publications and then output the final set to the template. > > Thanks for any help! --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---