diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2012-08-24 16:08:16 -0700 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@rd.io> | 2012-08-24 16:08:16 -0700 |
| commit | b7c3b044fcc354f675ff1941d9e4377d6782394c (patch) | |
| tree | d7b8a6b3d82ab4d5f1d23b293517ac57436bb624 | |
| parent | e57338f2b96c57d2060885cc23846317f50731c4 (diff) | |
Cleaned up the implementation of in_bulk
| -rw-r--r-- | django/db/models/query.py | 4 |
1 files changed, 1 insertions, 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): |
