From 340eaded4e30cf25bcd4e9781d33a617fe9c0f84 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 8 Feb 2011 14:05:38 +0000 Subject: [PATCH] Fixed #15116 -- Strip ordering clause from in_bulk() queries, since ordering information will be lost. Thanks to lamby for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15457 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/query.py | 1 + 1 file changed, 1 insertion(+) diff --git a/django/db/models/query.py b/django/db/models/query.py index 3c43a57d4a..fa3971bc48 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -419,6 +419,7 @@ class QuerySet(object): 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):