#29838 closed Bug (fixed)
Hashing list in Q objects when using __in lookup
Reported by: | Andrew | Owned by: | Andrew |
---|---|---|---|
Component: | Utilities | Version: | 2.0 |
Severity: | Release blocker | Keywords: | hash, tuple, list |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
This bug was previously reported here - #29643.
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:
Code highlighting:
>>> 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:
Code highlighting:
hash(Node([('a', [1, 2])]))
Change History (6)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Patch needs improvement: | set |
---|---|
Severity: | Normal → Release blocker |
Triage Stage: | Unreviewed → Accepted |
Version: | master → 2.0 |
It qualifies for a backport to stable/2.1.x since it's a regression in 508b5debfb16843a8443ebac82c1fb91f15da687.
Note:
See TracTickets
for help on using tickets.
PR