Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleaned up the implementation of in_bulk

  • Loading branch information...
commit b7c3b044fcc354f675ff1941d9e4377d6782394c 1 parent e57338f
@alex alex authored Alex Gaynor committed
Showing with 1 addition and 3 deletions.
  1. +1 −3 django/db/models/
4 django/db/models/
@@ -498,9 +498,7 @@ def in_bulk(self, id_list):
"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):
Please sign in to comment.
Something went wrong with that request. Please try again.