I have a query that requires to filter exactly 2 authors with the ID
Theoretically,
Book.objects.filter(author__id=1, author__id=2).
which is not possible.
How can I solve this problem?
Cheers,
Mickey
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not intuitive at first but the answer is right in front of us.
If you want an exact match, you could potentially further filter this result by those items that only have exactly 2 authors.
If you want exact matches dynamically, how about something like this?: