[Answer]-How to use Q objects to check if any members of arbitrary-length list are in Many-To-Many Relationship

1👍

EDIT: To make this a little more in line with what you are looking for (although I would not necessarily recommend doing things this way), you could:

vallist=[]
for b in myTargetList:
    vallist.append(b.myField)

myObj2.objects.filter(myLocalObj1__in=myObj1.objects.filter(myField__in=vallist))

This is available in the Django docs here:
https://docs.djangoproject.com/en/dev/topics/db/queries/#lookups-that-span-relationships

Leave a comment