diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 141b8c9dc41..8c683139ee4 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1131,7 +1131,7 @@ def add_filter(self, filter_expr, connector=AND, negate=False, trim=False, # into the issue of separating it into many filters, and we need the value # available. if parts[-1] == 'pk': - if not hasattr(value, '__iter__'): + if not hasattr(value, '__iter__') or lookup_type == 'in': value = [value] parts = parts[:-1] for part in parts: