From b7c3b044fcc354f675ff1941d9e4377d6782394c Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 24 Aug 2012 16:08:16 -0700 Subject: [PATCH] Cleaned up the implementation of in_bulk --- django/db/models/query.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/django/db/models/query.py b/django/db/models/query.py index 090ef0b7be..05c049b31f 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -498,9 +498,7 @@ class QuerySet(object): "Cannot use 'limit' or 'offset' with in_bulk" if not id_list: return {} - qs = self._clone() - qs.query.add_filter(('pk__in', id_list)) - qs.query.clear_ordering(force_empty=True) + qs = self.filter(pk__in=id_list).order_by() return dict([(obj._get_pk_val(), obj) for obj in qs]) def delete(self):