Skip to content
Browse files

Cleaned up the implementation of in_bulk

  • Loading branch information...
1 parent e57338f commit b7c3b044fcc354f675ff1941d9e4377d6782394c @alex alex committed with Alex Gaynor
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):

0 comments on commit b7c3b04

Please sign in to comment.
Something went wrong with that request. Please try again.