You can use the search for the IN field, as @stepank suggests.
A bit more explanation: Django ORM uses special syntax to translate Python code into SQL statements. And just passing bool (if id defined) filter value is invalid syntax.
If you are new to Django, you can start with here . You can also refer to the full link . Turning to the documentation before asking is good practice. :)
source share