However I am still getting this error upon rendering QuerySets that use
the Q object and include the `__in` filter in the most recent release of
django, 2.1.2.
Here is my reproduction of the bug on master:
{{{
#!div style="font-size: 80%"
Code highlighting:
{{{#!python
>>> q = Q(a__in=[1, 2])
>>> q.__hash__()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/aspalding/Documents/django/django/utils/tree.py", line 89,
in __hash__
for child in self.children
TypeError: unhashable type: 'list'
}}}
}}}
Therefor the minimal reproduction for `NodeTest` would look like:
{{{
#!div style="font-size: 80%"
Code highlighting:
{{{#!python
hash(Node([('a', [1, 2])]))
}}}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29838>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by aspalding):
[https://github.com/django/django/pull/10502 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/29838#comment:1>
* needs_better_patch: 0 => 1
* version: master => 2.0
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
It qualifies for a backport to stable/2.1.x since it's a regression in
508b5debfb16843a8443ebac82c1fb91f15da687.
--
Ticket URL: <https://code.djangoproject.com/ticket/29838#comment:2>
Comment (by Tim Graham <timograham@…>):
In [changeset:"217f82d7139fd32f07adbfa92c5fb383d0ade577" 217f82d7]:
{{{
#!CommitTicketReference repository=""
revision="217f82d7139fd32f07adbfa92c5fb383d0ade577"
Refs #29838 -- Fixed make_hashable() for values that have lists or dicts
nested in tuples.
And for non-hashable values that are iterable, e.g. sets.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29838#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"dc5e75d419893bde33b7e439b59bdf271fc1a3f2" dc5e75d4]:
{{{
#!CommitTicketReference repository=""
revision="dc5e75d419893bde33b7e439b59bdf271fc1a3f2"
Fixed #29838 -- Fixed crash when combining Q objects with __in lookups and
lists.
Regression in fc6528b25ab1834be1a478b405bf8f7ec5cf860c.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29838#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"0df7ea1b87d9543995156d5c5c77886fc1a5a615" 0df7ea1]:
{{{
#!CommitTicketReference repository=""
revision="0df7ea1b87d9543995156d5c5c77886fc1a5a615"
[2.1.x] Fixed #29838 -- Fixed crash when combining Q objects with __in
lookups and lists.
Regression in fc6528b25ab1834be1a478b405bf8f7ec5cf860c.
Backport of 834c4ec8e4cfc43acf0525e0a4d8c914534f6afd,
217f82d7139fd32f07adbfa92c5fb383d0ade577, and
dc5e75d419893bde33b7e439b59bdf271fc1a3f2 from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29838#comment:5>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"4c675523bd3e45906bf6736444c65b066e25208c" 4c67552]:
{{{
#!CommitTicketReference repository=""
revision="4c675523bd3e45906bf6736444c65b066e25208c"
Refs #29838, Refs #28507 -- Made make_hashable() ignore key order.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29838#comment:6>