Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.2.X] Fixed #15116 -- Strip ordering clause from in_bulk() queries,…

… since ordering information will be lost. Thanks to lamby for the report and patch.

Backport of r15457 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15459 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit bbfdb36b5485adc84adf7c6090cbd0ea9789d02b 1 parent 27e7fcb
@freakboy3742 freakboy3742 authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  django/db/models/query.py
View
1  django/db/models/query.py
@@ -417,6 +417,7 @@ def in_bulk(self, id_list):
return {}
qs = self._clone()
qs.query.add_filter(('pk__in', id_list))
+ qs.query.clear_ordering(force_empty=True)
return dict([(obj._get_pk_val(), obj) for obj in qs.iterator()])
def delete(self):
Please sign in to comment.
Something went wrong with that request. Please try again.