[Answer]-Joint query many to many relationship in Django

1👍

You’re going to need to us a Q object. I’d try something like this:

from django.db.models import Q

Story.objects.filter(Q(creator=1) | Q(creator=2))

0👍

You can use Q objects for this:

https://docs.djangoproject.com/en/1.4/topics/db/queries/#complex-lookups-with-q-objects

Something like the following should do what you want:

Story.objects.filter(Q(creator=1), Q(creator=2))

Leave a comment