Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #15116 -- Strip ordering clause from in_bulk() queries, since o…

…rdering 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
  • Loading branch information...
commit 340eaded4e30cf25bcd4e9781d33a617fe9c0f84 1 parent 4e7c2ba
Russell Keith-Magee authored February 08, 2011

Showing 1 changed file with 1 addition and 0 deletions. Show diff stats Hide diff stats

  1. 1  django/db/models/query.py
1  django/db/models/query.py
@@ -419,6 +419,7 @@ def in_bulk(self, id_list):
419 419
             return {}
420 420
         qs = self._clone()
421 421
         qs.query.add_filter(('pk__in', id_list))
  422
+        qs.query.clear_ordering(force_empty=True)
422 423
         return dict([(obj._get_pk_val(), obj) for obj in qs.iterator()])
423 424
 
424 425
     def delete(self):

0 notes on commit 340eade

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