summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2018-06-18 14:22:27 +0100
committerTim Graham <timograham@gmail.com>2018-06-20 09:29:06 -0400
commitb0fbfae09334554124e1dccb7559d10f36e2f84c (patch)
tree151880d98ec39f04e921bbc689058232ef691831 /django
parentd21d1f9e056e5617a30978aa4f95a0402bab174b (diff)
Fixed #29503 -- Made __in lookup keep order of values in query.
Regression in 86eccdc8b67728d84440a46e5bf62c78f2eddf6d.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/lookups.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/lookups.py b/django/db/models/lookups.py
index 22dd56ced9..fa4561dabf 100644
--- a/django/db/models/lookups.py
+++ b/django/db/models/lookups.py
@@ -6,6 +6,7 @@ from django.core.exceptions import EmptyResultSet
from django.db.models.expressions import Func, Value
from django.db.models.fields import DateTimeField, Field, IntegerField
from django.db.models.query_utils import RegisterLookupMixin
+from django.utils.datastructures import OrderedSet
from django.utils.functional import cached_property
@@ -326,7 +327,7 @@ class In(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
if self.rhs_is_direct_value():
try:
- rhs = set(self.rhs)
+ rhs = OrderedSet(self.rhs)
except TypeError: # Unhashable items in self.rhs
rhs = self.rhs