On Feb 22, 2009, at 5:44 PM, 3xM <[email protected]> wrote:

>
>
>
> On Feb 21, 10:33 pm, Daniel Roseman <[email protected]>
> wrote:
>
>> No need for custom SQL here. This might work:
>> Project.objects.filter(persons=person_a, persons=person_b)
>
> Nope. It just returns projects including person_b.
>
>
>> Or you could probably do it with Q objects:
>> Project.objects.filter(Q(persons=person_a) & Q(persons=person_b))
>
> Doesn't work either. This one returns no results, just like chaining
> filters.
>
I think the above was just a clue, if you need "OR" condition instead  
of "AND", you need to use "|" not "&" so:

Project.objects.filter(Q(persons=persons_a) | Q(persons=persons_b))

> Any other suggestions? Does it work for you? Maybe I'm doing something
> wrong?
>
> --
>
> Mikkel
> >

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to